From a474bc61ed5978e92c794877e3197b10593288dc Mon Sep 17 00:00:00 2001 From: John Hess Date: Wed, 30 Mar 2022 16:40:50 -0500 Subject: [PATCH] Add jekyll-multiple-language-plugin and refactor strings into /_i18n --- Gemfile | 4 +++ _config.yml | 2 ++ _data/home.yml | 47 ++++++------------------------- _data/en/home.yml => _i18n/en.yml | 25 +++++++--------- _data/es/home.yml => _i18n/es.yml | 22 ++++++--------- _includes/footer.html | 5 +--- _includes/modal.html | 14 ++++----- _layouts/basic.html | 2 +- captive.html | 8 +++--- index.html | 17 ++++++----- 10 files changed, 53 insertions(+), 93 deletions(-) rename _data/en/home.yml => _i18n/en.yml (72%) rename _data/es/home.yml => _i18n/es.yml (78%) diff --git a/Gemfile b/Gemfile index 6c38134..d011e36 100644 --- a/Gemfile +++ b/Gemfile @@ -16,6 +16,7 @@ gem "jekyll", "~> 4.2.0" # If you have any plugins, put them here! group :jekyll_plugins do gem "jekyll-feed", "~> 0.12" + gem 'jekyll-multiple-languages-plugin' end # Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem @@ -27,3 +28,6 @@ end # Performance-booster for watching directories on Windows gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin] + +# HTTP Server for local development +gem "webrick", "~> 1.7" \ No newline at end of file diff --git a/_config.yml b/_config.yml index 740065e..8c5fbca 100644 --- a/_config.yml +++ b/_config.yml @@ -6,6 +6,7 @@ url: "" # the base hostname & protocol for your site, e.g. http://example.com twitter_username: Butter App github_username: Butter App logo: "/assets/images/butter-app-logo-small.svg" +languages: ['en', 'es'] # powered by jekyll-multiple-languages-plugin # Build settings sass: @@ -14,6 +15,7 @@ sass: plugins: - jekyll-feed + - jekyll-multiple-languages-plugin # Exclude from processing. # The following items will not be processed, by default. diff --git a/_data/home.yml b/_data/home.yml index dd7c98e..689898c 100644 --- a/_data/home.yml +++ b/_data/home.yml @@ -1,46 +1,15 @@ -site_name: 'Butter' -page_logo: ['/assets/images/butter-logo-feature-large.svg', 'Butter App Feature Logo'] -title: 'Life without internet made smoother.
Get access to tools that help.' -text: - show_chat: | - This Butter Box offers an Android app store and chat rooms.
- Download the Butter app to discover and download free, ad-free
- apps or to spread the love and share apps offline. Or, create a
- chat room which hangs on to messages while you're gone and
- delivers them whenever your device reconnects to the Butter Box. - dont_show_chat: | - Butter features a collection of apps to make life without
the internet a little smoother. Use it to discover and download
free, ad-free apps or to spread the love and share offline. -fdroid_apps_caption: Just a few of the apps available via Butter. -fdroid_button_text: 'Download Android App' -chat_button_text: 'Start a chat room instantly' -image: ['/assets/images/butter-collection-features-offline-essentials.svg', 'Butter App features collection'] +# This file is sitewide, for all languages. +# To specify per-language data, use the _i18n folder's yml files. -modal_data: - title: 'Butter: Free, ad-free apps to help you offline' - logo: ['/assets/images/butter-app-icon-large.svg', 'Butter App Logo'] - text: | - Be in-the-know, be entertained, manage business and life—even with little internet. - Butter app makes it easy to find apps that use less internet and battery. - Download your favorites, and get free updates from Butter. Care to share? Send any app on your phone to a friend near you with Butter nearby. No internet needed. - info_list: - - By Team Butter - - Available for Android phones - - Less than 10 MB! - button_text: 'Download Android App' +page_logo: '/assets/images/butter-logo-feature-large.svg' +app_tiles_image: '/assets/images/butter-collection-features-offline-essentials.svg' + +modal: + butter_app_logo: '/assets/images/butter-app-icon-large.svg' button_url: '/assets/download/butter.apk' slider_list: - '/assets/images/slide-img-1.png' - '/assets/images/slide-img-2.png' - '/assets/images/slide-img-3.png' - '/assets/images/slide-img-4.png' - - '/assets/images/slide-img-5.png' - warning: | - You will need to enable downloads from unknown sources to install this app on your Android phone. - -captive_data: - welcome_message: | - Welcome to Butterbox. - welcome_details: | - This network doesn't provide internet access, just the next best thing, the Butter app. Butter features a collection of apps to make life without the internet a little smoother. -

Once you've connected, simply open http://butterbox.lan in your browser. - continue_button: 'Continue' \ No newline at end of file + - '/assets/images/slide-img-5.png' \ No newline at end of file diff --git a/_data/en/home.yml b/_i18n/en.yml similarity index 72% rename from _data/en/home.yml rename to _i18n/en.yml index dd7c98e..068d4f7 100644 --- a/_data/en/home.yml +++ b/_i18n/en.yml @@ -1,5 +1,5 @@ site_name: 'Butter' -page_logo: ['/assets/images/butter-logo-feature-large.svg', 'Butter App Feature Logo'] +page_logo_alt: 'Butter App Feature Logo' title: 'Life without internet made smoother.
Get access to tools that help.' text: show_chat: | @@ -11,13 +11,15 @@ text: dont_show_chat: | Butter features a collection of apps to make life without
the internet a little smoother. Use it to discover and download
free, ad-free apps or to spread the love and share offline. fdroid_apps_caption: Just a few of the apps available via Butter. -fdroid_button_text: 'Download Android App' -chat_button_text: 'Start a chat room instantly' -image: ['/assets/images/butter-collection-features-offline-essentials.svg', 'Butter App features collection'] +fdroid_button_text: 'DOWNLOAD ANDROID APP' +chat_button_text: 'CREATE A CHAT ROOM' +app_tiles_image_alt: 'Butter App features collection' +view_all_apps: 'View All Apps' +built_on_fdroid: Built on F-Droid Free Software -modal_data: +modal: title: 'Butter: Free, ad-free apps to help you offline' - logo: ['/assets/images/butter-app-icon-large.svg', 'Butter App Logo'] + butter_app_logo_alt: 'Butter App Logo' text: | Be in-the-know, be entertained, manage business and life—even with little internet. Butter app makes it easy to find apps that use less internet and battery. @@ -26,18 +28,11 @@ modal_data: - By Team Butter - Available for Android phones - Less than 10 MB! - button_text: 'Download Android App' - button_url: '/assets/download/butter.apk' - slider_list: - - '/assets/images/slide-img-1.png' - - '/assets/images/slide-img-2.png' - - '/assets/images/slide-img-3.png' - - '/assets/images/slide-img-4.png' - - '/assets/images/slide-img-5.png' + button_text: 'DOWNLOAD ANDROID APP' warning: | You will need to enable downloads from unknown sources to install this app on your Android phone. -captive_data: +captive: welcome_message: | Welcome to Butterbox. welcome_details: | diff --git a/_data/es/home.yml b/_i18n/es.yml similarity index 78% rename from _data/es/home.yml rename to _i18n/es.yml index 8bd6531..09594d5 100644 --- a/_data/es/home.yml +++ b/_i18n/es.yml @@ -1,5 +1,5 @@ site_name: 'Mantequilla' -page_logo: ['/assets/images/butter-logo-feature-large.svg', 'Butter App Feature Logo'] +page_logo_alt: 'Logo de Mantequilla' title: 'Para hacer tu vida sin Internet más fácil. Obtén herramientas que ayudan.' text: show_chat: | @@ -8,13 +8,14 @@ text: Mantequilla presenta una colección de aplicaciones para ayudarte cuando no tienes acceso a Internet. Úsala para descubrir y descargar aplicaciones gratuitas y sin publicidad o compartir cuando no tienes conexión. fdroid_apps_caption: Unas aplicaciónes disponible de Mantequilla fdroid_button_text: 'DESCARGA LA APLICACIÓN ANDROID' -chat_button_text: Crea una sala de chat -image: ['/assets/images/butter-collection-features-offline-essentials.svg', 'Butter App features collection'] +chat_button_text: 'CREA UN SALA DE CHAT' +app_tiles_image_alt: 'colección de aplicaciones de Mantequilla' +view_all_apps: 'Ver todas las aplicaciones' +built_on_fdroid: 'Basado en el software libre F-Droid' - -modal_data: +modal: title: 'Mantequilla: aplicaciones gratuitas y sin anuncios para ayudarte cuando no tienes acceso a internet' - logo: ['/assets/images/butter-app-icon-large.svg', 'Butter App Logo'] + butter_app_logo_alt: 'Logo de aplicación Mantequilla' text: | Mantente al tanto, diviértete, administra tus negocios y tu vida, incluso con poco Internet. La aplicación Mantequilla facilita la tarea de encontrar aplicaciones que usan menos Internet y batería. Descarga tus favoritas y obtén actualizaciones gratuitas de Mantequilla. ¿Te interesa compartir? Envía cualquier aplicación en tu teléfono a un amigo cerca de ti con “Mantequilla cercano”. No se necesita internet. info_list: @@ -22,17 +23,10 @@ modal_data: - Disponible para teléfonos Android - Menos de 10 MB! button_text: 'DESCARGA' - button_url: '/assets/download/butter.apk' - slider_list: - - '/assets/images/slide-img-1.png' - - '/assets/images/slide-img-2.png' - - '/assets/images/slide-img-3.png' - - '/assets/images/slide-img-4.png' - - '/assets/images/slide-img-5.png' warning: | Debes 'habilitar descargas de fuentes desconocidas' para descargar esta aplicación en tu teléfono Android. -captive_data: +captive: welcome_message: | Bienvenido. Esto es "como la mantequilla." welcome_details: | diff --git a/_includes/footer.html b/_includes/footer.html index 5640e3b..c425dc8 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -1,10 +1,7 @@ diff --git a/_includes/modal.html b/_includes/modal.html index 7c3ba09..1a8e809 100644 --- a/_includes/modal.html +++ b/_includes/modal.html @@ -7,26 +7,26 @@
diff --git a/_layouts/basic.html b/_layouts/basic.html index 24da5d6..57d08ef 100644 --- a/_layouts/basic.html +++ b/_layouts/basic.html @@ -5,7 +5,7 @@ {% include seo.html %} - {{ site.title }} + {% t title %} diff --git a/captive.html b/captive.html index 95c7392..8a8e5a1 100644 --- a/captive.html +++ b/captive.html @@ -7,14 +7,14 @@ layout: basic
- {{ page_data.page_logo[1] }} -

{{ page_data.captive_data.welcome_message }}

-

{{ page_data.captive_data.welcome_details }}

+ {% t page_logo_alt %} +

{% t captive.welcome_message %}

+

{% t captive.welcome_details %}

- +
diff --git a/index.html b/index.html index 4cbaf94..a1a4439 100644 --- a/index.html +++ b/index.html @@ -7,24 +7,23 @@ layout: default
- {{ page_data.page_logo[1] }} -

{{ page_data.title }}

+ {% t page_logo_alt %} +

{% t title %}

{% if site.data.deployment.show_chat %} - {{ page_data.text.show_chat }} + {% t text.show_chat %} {% else %} - {{ page_data.text.dont_show_chat }} + {% t text.dont_show_chat %} {% endif %}

- {{ page_data.image[1] }} -

{{ page_data.fdroid_apps_caption }}

+ {% t app_tiles_image_alt %} +

{% t fdroid_apps_caption %}

- {{ page_data.fdroid_button_text | upcase }} + {% t fdroid_button_text %} {% if site.data.deployment.show_chat %} - {{ page_data.chat_button_text | upcase }} + {% t chat_button_text %} {% endif %} -

{{ page_data.chat_text }}