-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds i18n support for the app, being rendered in client-side so that translations can be loaded dynamically. Implemented language fallbacks for non-existing translations, plurals and dynamic placeholders for strings. Fixes #38
- Loading branch information
Showing
7 changed files
with
121 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ env: | |
node: true | ||
browser: true | ||
es6: true | ||
jquery: true | ||
parserOptions: | ||
ecmaVersion: 2017 | ||
plugins: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
var current_locale = window.navigator.language | ||
|
||
$.i18n({ | ||
locale: current_locale, | ||
}) | ||
|
||
$.i18n() | ||
.load('./static/js/i18n', current_locale) | ||
.done(function() { | ||
$(window).on('load', function() { | ||
console.log('i18n:' + current_locale + ' locale loaded') | ||
$('body').i18n() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"page-title": "Google Code-in 2017 Current Leaders", | ||
"last-updated": "Last updated", | ||
"order-info": "The leading participants for each organization (and their GitHub accounts, if applicable) are listed randomly.", | ||
"tasks-completed": "Tasks Completed", | ||
"footer-text": "Google Code-in and the Google Code-in logo are trademarks of Google Inc.", | ||
"orgs-no-listed": "Organization(s) with no listed leaders", | ||
"passed": "$1% passed, approximately $2 before task claiming ends", | ||
"seconds-ago": "$1 {{PLURAL:$1|second|seconds}} ago", | ||
"minutes-ago": "$1 {{PLURAL:$1|minute|minutes}} ago", | ||
"hours-ago": "$1 {{PLURAL:$1|hour|hours}} ago", | ||
"days-ago": "$1 {{PLURAL:$1|day|days}} ago", | ||
"months-ago": "$1 {{PLURAL:$1|month|months}} ago", | ||
"years-ago": "$1 {{PLURAL:$1|year|years}} ago", | ||
"seconds": "$1 {{PLURAL:$1|second|seconds}}", | ||
"minutes": "$1 {{PLURAL:$1|minute|minutes}}", | ||
"hours": "$1 {{PLURAL:$1|hour|hours}}", | ||
"days": "$1 {{PLURAL:$1|day|days}}", | ||
"months": "$1 {{PLURAL:$1|month|months}}", | ||
"years": "$1 {{PLURAL:$1|year|years}}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"page-title": "Líderes actuales de Google Code-in 2017", | ||
"last-updated": "Última actualización", | ||
"order-info": "Los participantes líderes de cada organización (y sus respectivas cuentas de GitHub) están listados de forma aleatoria.", | ||
"tasks-completed": "Tareas completadas", | ||
"footer-text": "Google Code-in y su logotipo son marcas registradas de Google Inc.", | ||
"orgs-no-listed": "Organizacion(es) sin listado de líderes", | ||
"passed": "$1% completado, aproximadamente $2 hasta que termine el periodo de tareas", | ||
"seconds-ago": "hace $1 {{PLURAL:$1|segundo|segundos}}", | ||
"minutes-ago": "hace $1 {{PLURAL:$1|minuto|minutos}}", | ||
"hours-ago": "hace $1 {{PLURAL:$1|hora|horas}}", | ||
"days-ago": "hace $1 {{PLURAL:$1|día|días}}", | ||
"months-ago": "hace $1 {{PLURAL:$1|mes|meses}}", | ||
"years-ago": "hace $1 {{PLURAL:$1|año|años}}", | ||
"seconds": "$1 {{PLURAL:$1|segundo|segundos}}", | ||
"minutes": "$1 {{PLURAL:$1|minuto|minutos}}", | ||
"hours": "$1 {{PLURAL:$1|hora|horas}}", | ||
"days": "$1 {{PLURAL:$1|día|días}}", | ||
"months": "$1 {{PLURAL:$1|mes|meses}}", | ||
"years": "$1 {{PLURAL:$1|año|años}}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters