From b8ce517455bd9e2050653525a2c52dbef83cff1d Mon Sep 17 00:00:00 2001 From: Christian Kaisermann Date: Tue, 19 Nov 2019 17:14:48 -0300 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20move=20about=20messa?= =?UTF-8?q?ges=20to=20their=20own=20dir=20(not=20working)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/messages/default.json | 3 --- example/messages/en-US.json | 3 --- example/messages/es-ES.json | 3 --- example/messages/pt-BR.json | 3 --- example/src/routes/_layout.svelte | 8 +++--- example/src/routes/about.svelte | 15 ----------- .../src/routes/about/_locales/default.json | 7 +++++ example/src/routes/about/_locales/en-US.json | 7 +++++ example/src/routes/about/_locales/es-ES.json | 7 +++++ example/src/routes/about/_locales/pt-BR.json | 7 +++++ example/src/routes/about/index.svelte | 27 +++++++++++++++++++ 11 files changed, 59 insertions(+), 31 deletions(-) delete mode 100644 example/src/routes/about.svelte create mode 100644 example/src/routes/about/_locales/default.json create mode 100644 example/src/routes/about/_locales/en-US.json create mode 100644 example/src/routes/about/_locales/es-ES.json create mode 100644 example/src/routes/about/_locales/pt-BR.json create mode 100644 example/src/routes/about/index.svelte diff --git a/example/messages/default.json b/example/messages/default.json index c3b7e92..fb80aae 100644 --- a/example/messages/default.json +++ b/example/messages/default.json @@ -1,10 +1,7 @@ { "title": { - "about": "About", "index": "Sapper project template!" }, - "about_this_site": "About this site", - "about_content": ["This is the 'about' page. There's not much here."], "messages": { "success": "Great success!", "high_five": "High five", diff --git a/example/messages/en-US.json b/example/messages/en-US.json index c3b7e92..fb80aae 100644 --- a/example/messages/en-US.json +++ b/example/messages/en-US.json @@ -1,10 +1,7 @@ { "title": { - "about": "About", "index": "Sapper project template!" }, - "about_this_site": "About this site", - "about_content": ["This is the 'about' page. There's not much here."], "messages": { "success": "Great success!", "high_five": "High five", diff --git a/example/messages/es-ES.json b/example/messages/es-ES.json index 0efe216..bdab2c7 100644 --- a/example/messages/es-ES.json +++ b/example/messages/es-ES.json @@ -1,10 +1,7 @@ { "title": { - "about": "Acerca de", "index": " Plantilla de proyecto Sapper!" }, - "about_this_site": " Acerca de este sitio", - "about_content": ["Esta es la página 'acerca de'. No hay mucho aquí."], "messages": { "success": "Gran éxito!", "high_five": "Cinco altos", diff --git a/example/messages/pt-BR.json b/example/messages/pt-BR.json index 012af99..f329c42 100644 --- a/example/messages/pt-BR.json +++ b/example/messages/pt-BR.json @@ -1,10 +1,7 @@ { "title": { - "about": "Sobre", "index": "Modelo de projeto em Sapper!" }, - "about_this_site": "Sobre este site", - "about_content": ["Esta é a página 'sobre'. Não há muito aqui."], "messages": { "success": "Suuuucesso!", "high_five": "Toca aqui", diff --git a/example/src/routes/_layout.svelte b/example/src/routes/_layout.svelte index c276ca9..22b39e7 100644 --- a/example/src/routes/_layout.svelte +++ b/example/src/routes/_layout.svelte @@ -1,5 +1,5 @@ - - - {$_('title.about', { default: 'About' })} - - -

{$_('about_this_site', { default: 'About this site' })}

- -

- {$_('about_content[0]', { - default: "This is the 'about' page. There's not much here.", - })} -

diff --git a/example/src/routes/about/_locales/default.json b/example/src/routes/about/_locales/default.json new file mode 100644 index 0000000..4b22138 --- /dev/null +++ b/example/src/routes/about/_locales/default.json @@ -0,0 +1,7 @@ +{ + "title": { + "about": "About" + }, + "about_this_site": "About this site", + "about_content": ["This is the 'about' page. There's not much here."] +} diff --git a/example/src/routes/about/_locales/en-US.json b/example/src/routes/about/_locales/en-US.json new file mode 100644 index 0000000..4b22138 --- /dev/null +++ b/example/src/routes/about/_locales/en-US.json @@ -0,0 +1,7 @@ +{ + "title": { + "about": "About" + }, + "about_this_site": "About this site", + "about_content": ["This is the 'about' page. There's not much here."] +} diff --git a/example/src/routes/about/_locales/es-ES.json b/example/src/routes/about/_locales/es-ES.json new file mode 100644 index 0000000..53e4353 --- /dev/null +++ b/example/src/routes/about/_locales/es-ES.json @@ -0,0 +1,7 @@ +{ + "title": { + "about": "Acerca de" + }, + "about_this_site": " Acerca de este sitio", + "about_content": ["Esta es la página 'acerca de'. No hay mucho aquí."] +} diff --git a/example/src/routes/about/_locales/pt-BR.json b/example/src/routes/about/_locales/pt-BR.json new file mode 100644 index 0000000..2dc5e8f --- /dev/null +++ b/example/src/routes/about/_locales/pt-BR.json @@ -0,0 +1,7 @@ +{ + "title": { + "about": "Sobre" + }, + "about_this_site": "Sobre este site", + "about_content": ["Esta é a página 'sobre'. Não há muito aqui."] +} diff --git a/example/src/routes/about/index.svelte b/example/src/routes/about/index.svelte new file mode 100644 index 0000000..7310b21 --- /dev/null +++ b/example/src/routes/about/index.svelte @@ -0,0 +1,27 @@ + + + + + + {$_('title.about', { default: 'About' })} + + +

{$_('about_this_site', { default: 'About this site' })}

+ +

+ {$_('about_content[0]', { + default: "This is the 'about' page. There's not much here.", + })} +