Skip to content

Commit

Permalink
Merge pull request #326 from wikimedia/i18n
Browse files Browse the repository at this point in the history
Set up i18n and make main messages to be translatable
  • Loading branch information
cimurah authored Feb 9, 2021
2 parents 3f1c33b + 9497b6f commit 1d727c9
Show file tree
Hide file tree
Showing 14 changed files with 2,020 additions and 56 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ jobs:
run: |
composer install
./bin/console doctrine:migrations:migrate --no-interaction
npm ci
- name: Test
run: |
composer test
./bin/phpunit --exclude-group=exclude-from-ci
npm test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public/opds/*
/src/.preload.php
/var/
/vendor/
/node_modules/
###< symfony/framework-bundle ###

###> symfony/phpunit-bridge ###
Expand Down
14 changes: 14 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* eslint-env node */
module.exports = function Gruntfile( grunt ) {

grunt.loadNpmTasks( 'grunt-banana-checker' );

grunt.initConfig( {
banana: {
all: {
src: 'i18n/'
}
}
} );

};
3 changes: 3 additions & 0 deletions config/packages/toolforge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
toolforge:
intuition:
domain: 'ws-export'
43 changes: 43 additions & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"@metadata": {},
"app-title": "WS Export",
"app-subtitle": "Export books from Wikisources in many different file formats.",
"footer-version": "This is $1 version $2.",
"version": "version $1",
"commit-label": "Commit: $1",
"licensed-under": "It is licensed under $1.",
"license-link": "GPL v2 or later",
"source-and-docs": "The source code is available $1 and some documentation $2.",
"source-link": "on Github",
"docs-link": "on Multilingual Wikisource",
"statistics": "Some $1 are also provided.",
"statistics-link": "statistics",
"issues": "Please report issues under the $1 project on Pabricator.",
"issue-button": "Create issue",
"export-book": "Export a book",
"lang-field-label": "Language code:",
"lang-field-help": "Wikisource language code or subdomain, such as 'en' or 'fr'.",
"title-field-label": "Title:",
"title-field-help": "Title of the book's main page.",
"format-field-label": "File format:",
"format-field-help": "",
"format-epub-3": "EPUB 3 (for most ereaders)",
"format-epub-2": "EPUB 2 (deprecated, may be useful for some very old ereaders)",
"format-htmlz": "HTML",
"format-mobi": "MOBI (for Kindles)",
"format-pdf-a4": "PDF - A4 size",
"format-pdf-a5": "PDF - A5 size",
"format-pdf-a6": "PDF - A6 size",
"format-pdf-letter": "PDF - US letter size",
"format-rtf": "RTF",
"format-txt": "Plain text",
"invalid-format": "\"$1\" is not a valid format. Valid formats are: $2",
"font-field-label": "Font:",
"no-font-option": "None (use device default)",
"font-field-help": "Choose from $1 available fonts.",
"options-label": "Options:",
"images-field-label": "Do not include images",
"nocache-field-label": "Bypass all caching (slower but useful for debugging)",
"export-button": "Export",
"cache-updated": "The cache has been refreshed for language: $1"
}
43 changes: 43 additions & 0 deletions i18n/qqq.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"@metadata": {},
"app-title": "Application title, used in various places.",
"app-subtitle": "Application subtitle, at the top of every page.",
"footer-version": "Application name and version statement. $1 is the application title; $2 is a link to the current version (constructed with the 'version' message below).",
"version": "Text for the version link. $1 is the current version number.",
"commit-label": "Tooltip for the version link. $1 is the current commit's short hash.",
"licensed-under": "License statement. $1 is a link with the text of the 'license-link' message.",
"license-link": "Text for the license link, included in the 'licensed-under' message.",
"source-and-docs": "Source code and documentation statement. $1 is a link with the text of the 'source-link' message, and $2 a link with the text of the 'docs-link' message.",
"source-link": "Link text for the link to Github, included in the 'source-and-docs' message.",
"docs-link": "Link text for the link to the tool's documentation Multilingual Wikisource, included in the 'source-and-docs' message",
"statistics": "Statistics statement. $1 is a link to the statistics page, with text from the 'statistics-link' message.",
"statistics-link": "Link text for the link to the statistics page, used in the 'statistics' message.",
"issues": "Statement about bug reporting. $1 is a link to Phabricator, with '#wsexport' as the link text (untranslatable, because it's not translatable in Phabricator).",
"issue-button": "Button text on a link to create a new bug report.",
"export-book": "Header for the main export form.",
"lang-field-label": "Form field label for the 'Language' field.",
"lang-field-help": "Help text for the 'Language' field.",
"title-field-label": "Form field label for the 'Title' field.",
"title-field-help": "Help text for the 'Title' field.",
"format-field-label": "Form field label for the 'Format' field.",
"format-field-help": "Help text for the 'Format' field. Not currently used for English, but other languages may use it.",
"format-epub-3": "Format label and description.",
"format-epub-2": "Format label and description.",
"format-htmlz": "Format label and description.",
"format-mobi": "Format label and description.",
"format-pdf-a4": "Format label and description.",
"format-pdf-a5": "Format label and description.",
"format-pdf-a6": "Format label and description.",
"format-pdf-letter": "Format label and description.",
"format-rtf": "Format label and description.",
"format-txt": "Format label and description.",
"invalid-format": "Error message displayed when an invalid format is given in the URL. $1 is the user-supplied format; $2 is a list of valid formats (which are not translatable).",
"font-field-label": "Form field label for the 'Font' field.",
"no-font-option": "Font dropdown option to indicate that no font should be used.",
"font-field-help": "Help text for the 'Font' field. $1 is the total number of fonts (an integer).",
"options-label": "Form label for the set of 'Options' fields.",
"images-field-label": "Form field label for the 'do/don't include images' option field.",
"nocache-field-label": "Form field label for the 'disable caching' option field.",
"export-button": "Button text for the main export form.",
"cache-updated": "Message displayed after a user has requested a cache-refresh. $1 is the language code that was refreshed."
}
Loading

0 comments on commit 1d727c9

Please sign in to comment.