for example:
grep "no longer exist" locale/en/ManageIQ_UI_Classic.po |wc -l
31
where many of them are very similar:
msgid "%{models} no longer exists"
msgid "%{model} no longer exists"
msgid "%{model} no longer exists."
msgid "%{name} (no longer exists)"
msgid "%{record_name} no longer exists in the database"
msgid "%{record} no longer exists"
msgid "%{table} no longer exists"
msgid "Chart no longer exists"
msgid "Cloud Network no longer exists."
msgid "Cloud Subnet no longer exists."
msgid "Cloud Tenant no longer exists."
msgid "Cloud Volume Snapshot no longer exists."
msgid "Error: Record no longer exists in the database"
msgid "Floating IP no longer exists."
msgid "Last selected %{record_name} no longer exists"
msgid "Last selected Snapshot no longer exists"
msgid "MiqGroup no longer exists"
msgid "Policy no longer exists"
msgid "Provider no longer exists, this alert must be reconfigured"
msgid "RSS Feed no longer exists"
msgid "Report no longer exists"
msgid "Role no longer exists"
msgid "Router no longer exists."
msgid "Saved Report no longer exists"
msgid "Security Group no longer exists."
msgid "Selected %{model_name} no longer exists"
msgid "Selected Chargeback Report no longer exists"
msgid "Selected Saved Chargeback Report no longer exists"
msgid "Tenant no longer exists"
msgid "The selected job no longer exists, Delete all older Tasks was not completed"
msgid "User no longer exists"
I believe many of these can be extracted with a parameter, e.g. use:
_("String with param: %s") % param
or with multiple parameters:
_("Params: %{a} and %{b}") % {:a => foo, :b => bar}
Further, to use plural form use n_("One", "Two", number) - note this function always accepts three parameters as the base language is usually English but translators are able to define as many plural forms as they need.
Plural forms are usually used with one parameter, do not forget to add trailing parameter to it: n_("%s minute", "%s minutes", @param) % @param
Note that gettext does not extract from interpolation - this will not work: "blah #{_('key')} blah"
@ohadlevy: some of this is covered in: http://manageiq.org/docs/guides/i18n
note: any unification here is good on one side, on the other it may break the QE automation
thanks, I didn't see that - regardless the issues still present :)
On Thu, Nov 23, 2017 at 9:33 AM, Martin Povolny notifications@github.com
wrote:
@ohadlevy https://github.com/ohadlevy: some of this is covered in:
http://manageiq.org/docs/guides/i18n—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ManageIQ/manageiq-ui-classic/issues/2800#issuecomment-346546941,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABOxyDr3IQ9nzdNbsUnpROMEo1QHDtTks5s5R--gaJpZM4QnfPw
.
I don't quite understand what problem this report points to.
the point is that you can reduce the number of different strings - this simply adds burden on translators often leaving the application in semi translated state - where in fact, the same strings are already translated.
for example:
msgid "Report no longer exists"
msgid "Role no longer exists"
are identical strings, and in fact, already covered by
msgid "%{model} no longer exists."
and
msgid "%{model} no longer exists"
In fact, we're deliberately moving away from
msgid "%{model} no longer exists"
and replacing them with
msgid "Report no longer exists"
msgid "Role no longer exists"
when possible.
I get constantly asked by our translators what's %{model} in this case. What's %{model} in that case.
Since depending on the context, they would translate the string differently.
I'm all for unification and simplifying things when it's possible. Though what you're describing above
works reliably in English (and perhaps few other languages). It wouldn't work in languages with more
complicated conjugation and inflection rules.
I think that cleanup is on the way. But the result should be:
msgid "RSS Feed no longer exists"
msgid "Report no longer exists"
msgid "Role no longer exists"
msgid "Router no longer exists"
Rather than:
msgid "%{model} no longer exists"
It's more strings but, as @mzazrivec wrote, generally it gives more flexibility to the translators.
Especially these should go:
msgid "%{record} no longer exists"
msgid "%{table} no longer exists"
:+1: also the inconsistency with and without a dot ?
@ohadlevy : Fixed that. Thx!
This issue has been automatically marked as stale because it has not been updated for at least 6 months.
If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions!
@martinpovolny is this still a valid issue? If yes, lease remove the stale label. If not can you close.
If there's no update by next week, I'll be closing this issue.
Closing issue. If you feel the issue needs to remain open, please either reopen or let me know and it will be reopened.
@miq-bot close_issue
@miq-bot remove_label stale
This issue has been automatically marked as stale because it has not been updated for at least 6 months.
If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions!