Closed briri closed 6 years ago
I believe this is related to: https://github.com/ruby-gettext/gettext/issues/42
Here is a screenshot of a Brazilian Portuguese translation that was just recently created:
The app.po contains the following for the top visibility radio buttons:
msgid "Organisation: anyone at my organisation can view"
msgstr "Organização: qualquer pessoa em minha organização pode ver"
msgid "Organisation: anyone at my organisation can view."
msgstr "Organização: qualquer pessoa em minha organização pode ver."
...
msgid "Private: restricted to me and my collaborators"
msgstr "Privado: restrito a mim e a meus colaboradores"
msgid "Private: restricted to me and people I invite."
msgstr "Privado: restrito a mim e a meus convidados."
...
msgid "Public: anyone can view on the web"
msgstr "Público: qualquer usuário na web pode visualizar."
msgid "Public: anyone can view."
msgstr "Público: qualquer pessoa pode visualizar."
So it looks as though the app.pot file contains older versions of the messages (e.g. note the period '.' at the end of the Organisation ones in the yaml file. The screenshot shows that it was able to match the Organisation one and pull it in. The screenshot however shows the 'public' entry without a period but the yaml file does not have a version without the period. The 'Private' entry does not exist at all in the yaml.
I ran rake gettext:find
today and those entries were still not found.
I think we may want to consider moving away from embedding translatable text in Ruby's interpolated strings as mentioned here: https://github.com/ruby-gettext/gettext/issues/42
so move toward:
<% private = _('Private: visible to me, specified collaborators and administrators at my organisation') %>
<%= f.label :visibility_privately_visible, raw("#{f.radio_button :visibility, :privately_visible} #{private}) %>
instead of:
<%= f.label :visibility_privately_visible, raw("#{f.radio_button :visibility, :privately_visible}\
#{_('Private: visible to me, specified collaborators and administrators at my organisation')}") %>
Thanks to @stephaniesimms for pulling together this list of strings that are being missed.
Emails There is code in place that forces the system to use the default language when creating email messages. We should switch this to use the recipient's preferred language (or the default if none is specified)
Notification messages
Notification messages all partial and strange (some screenshots below)
Checkboxes and Radio buttons
We've been using string interpolation as a practice to create Bootstrapped checkboxes and radio buttons that still make use of Rails' ActionView form helpers to create these elements. We will need to adjust this by either using a '+' to combine the strings or set the label text as a variable
this is happening for these elements across the entire site. Some examples:
Specific areas of text The following text is likely not properly marked up for Gettext:
'See the full list' link for guidance selection
Autosave message temporal text 'just now' ... 'less than a minute ago'
Some headers on static pages (Terms of Use & Privacy e.g.)
Public plans description
New columns added to Users table
Headings for Edit user privileges modal
Header and button text for editing user profile
Header for 'Usage statistics'
Missed link text for Templates page 'All' 'Published' etc... but yes for Customization tab links???
'Add' and 'Edit' for buttons in template customization
The timeago.js files are also not getting discovered by gettext. We also peg the language to en_GB but should instead add the current user's language of choice to the json object defined at the bottom of application.rb and so that its available in the constants.js file.
also related to #166 which would pull the bootstrap, devise and contact_us strings into the app.pot
found a case where the label_tag was using a symbol instead of translatable text in the 'views/users/_admin_grant_permissions.htmlerb'
<%= label_tag :organisational_admin_privileges %>
should be <%= label_tag _('Organisational admin privileges') %>
Hello, when migrating from roadmap 0.3 to 1.0 I had some issues with the French version. I had the following error :
I18n::MissingTranslationData - translation missing: fr.date.formats.default:
i18n (0.9.5) lib/i18n.rb:326:in `handle_exception'
i18n (0.9.5) lib/i18n.rb:172:in `translate'
i18n (0.9.5) lib/i18n/backend/base.rb:81:in `localize'
gettext_i18n_rails (1.8.0) lib/gettext_i18n_rails/backend.rb:30:in `method_missing'
i18n (0.9.5) lib/i18n.rb:258:in `localize'
Unless I missed it, there is no task to update the abbreviation in the database from fr
to fr_FR
. I had to update the row in the db. (In the seed file, the abbreviation is fr
too).
Some YML file are still using "fr" as a prefix for the French language. Some files may not be used anymore :
config/locales/devise/devise.fr.yml
=> this one is used for devise notifications.config/locales/contact_us/contact_us.fr.yml
config/locales/devise/devise_invitable.fr.yml
config/locales/bootstrap/fr.bootstrap.yml
You should probably change the prefix in these files (and update the name).can't test UI but will verify as i monitor changes to the portuguese translation in dmptool. closing issue.
The
rake gettext:find
task doesn't seem to be picking up everything.The following 'Private: ...' section is not found in the app.pot file but the 'Organisation:' and 'Private:' ones are.
Interestingly though, some older versions are still in the app.pot: