Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of text translations #364

Closed
3 of 5 tasks
JackMorganNZ opened this issue Jun 27, 2016 · 2 comments
Closed
3 of 5 tasks

Improve handling of text translations #364

JackMorganNZ opened this issue Jun 27, 2016 · 2 comments
Assignees
Milestone

Comments

@JackMorganNZ
Copy link
Member

JackMorganNZ commented Jun 27, 2016

Description

The generation system has several issues when trying to handle translations:

  • The current guide-settings.conf configuration file requires the same output files for each language. This should be changed as each language should have it's own output (for example, there is no need for the NCEA curriculum guides to be translated to Polish).
  • The folder names should be changed for each language so the output URL will match the language (for example, chapter will be kapitel in German).
  • Static text (homepage, footer, sidebar, etc) is different for each language (current hard coded into HTML templates).
  • Interactives must be able to translated (this issue will be detailed separately on it's existing issue page Handle translations of interactives #71).
  • New documentation should be added on how to add a translation.

To do

  • Store structure for each language in settings file within language folder.
  • Store static text (homepage, footer, sidebar, etc) within the language settings file.
  • Load static text for a given language into HTML templates.
  • Translate interactives upon loading (Handle translations of interactives #71).
  • Add documentation.

To investigate

  • Which settings within generator-settings.conf must be moved to the guide-settings.conf.
  • If guide-settings.conf can be stored within the language text folder (for example, as text/en/settings.conf). Done.
  • If storing translations within a CSV for HTML generation is acceptable. Now storing text within language settings file.
  • If storing translations within a CSV for interactives is acceptable (see Handle translations of interactives #71).
@JackMorganNZ JackMorganNZ self-assigned this Jun 27, 2016
@JackMorganNZ JackMorganNZ added this to the Translations milestone Jun 27, 2016
JackMorganNZ added a commit that referenced this issue Jun 28, 2016
This allows each language to have it's own
custom output (created from #364).

Requires an error message to be logged if
the settings file is not found #365.
JackMorganNZ added a commit that referenced this issue Jun 29, 2016
This commit changes the following:
- Uses a YAML module to read the settings file
  to complete generation.
- Allows any folder name to be used for different
  text types.
- Stores the filename with and without the file
  extension in FileNodes.
- Reorganises the YAML to not uses lists when
  a dictionary is preferred.
- Removes the languages module, as the language
  code is set by the folder name, and the
  language name is not stored in the settings
  file.

Related to #364.
JackMorganNZ added a commit that referenced this issue Jun 29, 2016
The static text translations are now stored
within the language file, however most HTML
templates do not use these values yet.

To do:
- Use text from language file instead of
  hard coded text in templates
- Use boolean values from structure sections
  instead of hard coded generation values

Related to issue #364
@JackMorganNZ
Copy link
Member Author

Have organised the description of this issue to better show current progress.

@JackMorganNZ
Copy link
Member Author

This issue will now be closed in a partially completed state. This issue has helped form cleaner and more logical generation, however we are now developing a new system (using existing systems) to replace this generation script.

Settings are now stored for language in their text folder and can handle the translation text for that language. However there is currently no support for translations for interactives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant