-
Notifications
You must be signed in to change notification settings - Fork 16
Description
As we explore a bilingual version of TeSS, we find places were the I18n support has been missed in the TeSS source code.
We intend to work on these areas on our own fork, but I though it would be good for this work to benefit your upstream project too.
This issue is meant for a discussion of how to handle the problems before the work begins.
Here are some places where i18n hasn't been handled, some are easier to deal with than others:
- Strings directly in the view templates. These are easy to handle (just chuck in a
<%= t(:whatever) %>
as needed) - Strings returned by code (model, controller, helper) that don't go through I18n. These will take some searching to find, but are straightforward.
- ActiveRecord model/attribute stuff. These will be harder to detect, as some things only show up during error messages, etc. The path to the translated string in the locales files looks like
en.activerecord.models.<modelname>.attributes.<attributename>
. Some attributes have been handled in the locales files, but this would be a small proportion of all of the attributes. - Facets from controlled vocabularies. These need some thought and design work.
- Other stuff ... ?
For facets/dictionaries, we currently have things like: https://github.com/ElixirTeSS/TeSS/blob/master/config/dictionaries/difficulty.yml
What would likely need to happen is most of the content would be stripped out (leaving perhaps only the keys), and the English sentences get pulled out into the locales files (either put everything in en.yml
, create a locale file for all of the dictionaries, or create a local file for each dictionary). The "Language of Event" feature (PR #995), does have an example of a facet value that goes through I18n (but is this the approach we want to take with each of the dictionaries/facets?).
Anyways, I'd seek some input from anybody that has an opinion on this matter. (Worst case: if this is too much, we'll just make sure our bilingual version of TeSS is fully I18n-ed).