Difference between revisions of "ARK2/Localization"

From ARK
Jump to: navigation, search
(Created page with "= Localization = Localization is the process of translating the user interface and data into the language and formats of the user. ARK2 uses the following components for loc...")
 
(Localization)
 
(8 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
ARK2 uses the following components for localization and translation:
 
ARK2 uses the following components for localization and translation:
* The [http://symfony.com/doc/current/components/intl.html Symfony Intl] component as a wrapper for the [http://php.net/manual/en/book.intl.php PHP Intl] extension and using ICU, for collation, formatting and parsing
+
* The [http://symfony.com/doc/current/components/intl.html Symfony Intl] component as a wrapper for the [http://php.net/manual/en/book.intl.php PHP Intl] extension and ICU, for collation, formatting and parsing
 
* The [http://symfony.com/doc/current/components/translation.html Symfony Translation] component for translation
 
* The [http://symfony.com/doc/current/components/translation.html Symfony Translation] component for translation
* [http://punic.github.io/ Punic], using CLDR, as a source of some translations
+
* The standard JS [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl Intl API], or the [https://github.com/andyearnshaw/Intl.js Intl Polyfill] where Intl is not available
  
 +
== Translation ==
  
A key to providing Ark-As-A-Service will be translating the user interface and schemas into as many languages as possible to maximise the potential user base. ARK does not have the tools to make this process easy to perform or manage, and it would be a waste of resources to build them. It is recommended to use one of the existing online open-source translation projects to crowd-source the translations. This will allow interested parties and potential clients to translate ARK for themselves and to grow a local community to support ARK in their country.
+
* Translations are stored in the core database
 
+
* Translations are exported into XLIFF file format, allowing offline apps to download the full catalogue
Changes will be made to the translation process to bring ARK into line with industry best practices and tooling, allowing for common features such as correct plural forms.
+
* Translations uses keys rather than source strings
* Translations would be performed using the Symfony Translation package
 
* Translations will be stored and transmitted in the XLIFF file format
 
* Translations will use keys (similar to current, but expanded)
 
 
* Translations will be split in a number of catalogues:
 
* Translations will be split in a number of catalogues:
 +
** Vocabulary
 
** Core interface
 
** Core interface
 
** User interface
 
** User interface
 
** Admin interface
 
** Admin interface
 
** Schema (one for each created)
 
** Schema (one for each created)
 +
* Actor and User IDs are translated live using a custom loader from the database
 +
 +
The Admin Interface provides a basic interface for the maintaining of translation. Export and import interfaces are provided for the chosen online translation community.
 +
 +
== Translation Workflow ==
 +
 +
Translation workflow will have two modes, Debug and Live.
 +
* In Debug mode, the database is the canonical source for translations
 +
* In Live mode, the XLIFF files are the canonical source
 +
 +
In Debug mode:
 +
* Translations can be disabled in the site.json file for testing or development purposes
 +
* Translations are loaded live from the database
 +
* Translation Admin page shows stats, allows editing of translations, and import/export to XLIFF (also to translation website)
 +
* Translation extractors can be run to extract the used keys from code files
 +
* Translations can be edited in the Translation Profiler page
 +
** Profiler bar shows translation stats for the page
 +
** Profiler page allows live editing of translations used on the page with persistence back to the database and flagging as fuzzy
 +
 +
In Live mode:
 +
* Translations are always active, sites.json disable is ignored
 +
* Translations are loaded from the XLIFF files, database is only used for Actors/Users
 +
* Translation Admin page is available, but changes do not take effect until exported to XLIFF
 +
 +
== Development Required ==
  
Inparticular
+
No existing package supports our requirements so we will need to fork a number of existing projects (see below):
* Markup table will be dropped entirely
+
* Translation extractors
* Aliases will be kept as table-driven translations using a custom catalogue loader
+
* Translation admin page
* A custom Address Book catalogue loader will be used to provide names via the translation system
+
* Translation Profiler page
  
 +
== Design Decisions To Be Made ==
  
 
Potential online portals include:
 
Potential online portals include:
Line 31: Line 56:
 
* [http://zanata.org/ Zanata] - A Red Hat open-source project (in response to Transifex going closed) with free hosting and large existing community, or can be self-hosted (JBoss based), great features and automated workflow, API, Github integration, etc. No RTL?
 
* [http://zanata.org/ Zanata] - A Red Hat open-source project (in response to Transifex going closed) with free hosting and large existing community, or can be self-hosted (JBoss based), great features and automated workflow, API, Github integration, etc. No RTL?
 
* [https://weblate.org/en/features/ Weblate] - An open-source project with free and paid-for hosting, but no central community, or can be self-hosted, good features, API, Github integration, etc. Django based.
 
* [https://weblate.org/en/features/ Weblate] - An open-source project with free and paid-for hosting, but no central community, or can be self-hosted, good features, API, Github integration, etc. Django based.
 +
* https://localise.biz/ Free or GBP5 p/m plan may be enough, good api, Symfony bundle
 
* [http://translationproject.org/html/welcome.html Translation Project] - A FSF open-source project with free hosting and large existing community, but very basic features and manual workflow.
 
* [http://translationproject.org/html/welcome.html Translation Project] - A FSF open-source project with free hosting and large existing community, but very basic features and manual workflow.
 
* [http://pootle.translatehouse.org/index.html Pootle] - An open-source project, self-hosted, Django based
 
* [http://pootle.translatehouse.org/index.html Pootle] - An open-source project, self-hosted, Django based
Line 38: Line 64:
 
A number of options exist for automating extraction of Symfony translations, or for allowing interactive editing inside the admin panel or profiler panel:
 
A number of options exist for automating extraction of Symfony translations, or for allowing interactive editing inside the admin panel or profiler panel:
 
* https://jolicode.com/blog/translation-workflow-with-symfony2
 
* https://jolicode.com/blog/translation-workflow-with-symfony2
 +
* https://developer.happyr.com/how-happyr-work-with-symfony-translations
 
* https://github.com/deanc/silex-web-translator
 
* https://github.com/deanc/silex-web-translator
 
* https://github.com/Aecf/TranslatorToolBundle
 
* https://github.com/Aecf/TranslatorToolBundle
Line 43: Line 70:
 
* https://github.com/lexik/LexikTranslationBundle
 
* https://github.com/lexik/LexikTranslationBundle
 
* https://github.com/manuelj555/ManuelTranslationBundle
 
* https://github.com/manuelj555/ManuelTranslationBundle
 +
* https://github.com/Happyr/TranslationBundle
 +
* http://jmsyst.com/bundles/JMSTranslationBundle
  
 
None of these quite match our requirements, but may be adapted to achieve our workflow.
 
None of these quite match our requirements, but may be adapted to achieve our workflow.
 +
 +
Translations in javascript:
 +
* https://github.com/willdurand/BazingaJsTranslationBundle
 +
* https://github.com/wikimedia/jquery.i18n

Latest revision as of 23:32, 5 March 2018

Localization

Localization is the process of translating the user interface and data into the language and formats of the user.

ARK2 uses the following components for localization and translation:

Translation

  • Translations are stored in the core database
  • Translations are exported into XLIFF file format, allowing offline apps to download the full catalogue
  • Translations uses keys rather than source strings
  • Translations will be split in a number of catalogues:
    • Vocabulary
    • Core interface
    • User interface
    • Admin interface
    • Schema (one for each created)
  • Actor and User IDs are translated live using a custom loader from the database

The Admin Interface provides a basic interface for the maintaining of translation. Export and import interfaces are provided for the chosen online translation community.

Translation Workflow

Translation workflow will have two modes, Debug and Live.

  • In Debug mode, the database is the canonical source for translations
  • In Live mode, the XLIFF files are the canonical source

In Debug mode:

  • Translations can be disabled in the site.json file for testing or development purposes
  • Translations are loaded live from the database
  • Translation Admin page shows stats, allows editing of translations, and import/export to XLIFF (also to translation website)
  • Translation extractors can be run to extract the used keys from code files
  • Translations can be edited in the Translation Profiler page
    • Profiler bar shows translation stats for the page
    • Profiler page allows live editing of translations used on the page with persistence back to the database and flagging as fuzzy

In Live mode:

  • Translations are always active, sites.json disable is ignored
  • Translations are loaded from the XLIFF files, database is only used for Actors/Users
  • Translation Admin page is available, but changes do not take effect until exported to XLIFF

Development Required

No existing package supports our requirements so we will need to fork a number of existing projects (see below):

  • Translation extractors
  • Translation admin page
  • Translation Profiler page

Design Decisions To Be Made

Potential online portals include:

  • Transifex - Market leader, but now closed source, offers free hosting to open source projects, large community, great features and automated workflow, API, Github integration, etc.
  • Zanata - A Red Hat open-source project (in response to Transifex going closed) with free hosting and large existing community, or can be self-hosted (JBoss based), great features and automated workflow, API, Github integration, etc. No RTL?
  • Weblate - An open-source project with free and paid-for hosting, but no central community, or can be self-hosted, good features, API, Github integration, etc. Django based.
  • https://localise.biz/ Free or GBP5 p/m plan may be enough, good api, Symfony bundle
  • Translation Project - A FSF open-source project with free hosting and large existing community, but very basic features and manual workflow.
  • Pootle - An open-source project, self-hosted, Django based

Zanata would seem the preferred option for a hosted service, but Weblate might be better if self-hosting.

A number of options exist for automating extraction of Symfony translations, or for allowing interactive editing inside the admin panel or profiler panel:

None of these quite match our requirements, but may be adapted to achieve our workflow.

Translations in javascript: