Closed (fixed)
Project:
Ray Enterprise Translation
Version:
7.x-5.04
Component:
Code
Priority:
Major
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Sep 2013 at 20:28 UTC
Updated:
17 Dec 2015 at 23:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
robertdbailey commentedHi Ezra, Team,
Explanations for each of these gaps in translation are below:
#1 - The Spanish translation for "Posts" in this case is also "Posts". When I translate to another language, Arabic for example, "Posts" is translated to an Arabic string correctly.
#2 - This string is not prepared in the code for translation (ie. not using a t-function). In the commons code in "profiles/commons/modules/contrib/commons_wikis/commons_wikis.features.inc":
"value" : "\u003Ca href=\u0022[message:user:url:absolute]\u0022\u003E[message:user:name]\u003C\/a\u003E has updated the \u003Ca href=\u0022[message:field-target-nodes:0:url]\u0022\u003E[message:field-target-nodes:0:title]\u003C\/a\u003E wiki page",
Notice the string begins to be translated after "wiki page". This is something that could be patched by the commons_wikis maintainers.
#3 - The Events tab is a special tab, governed by the commons_events module. The translation of the tab's string can happen as a menu_link, but the steps Commons is taking to display that tab does not seem to include honoring the localization. If I step through the Commons code and update the display-related strings of "'Events'" to use the t-function "t('Events')", and if I play with the translation settings in the menu_link, then I can get the localization to show up. But this will not happen by default for that tab in its current state.
#4 - This "TODO(S)" menu item contains some HTML; so on the initial translation pass coming from the l10n_update module, it excludes it from being used. This note which I think is related appears in the recent-log report: "Disallowed HTML detected. String not imported: ".
A second pass through the Lingotek "Sync" page should pick up this missing string and provide the translation. (It did on my test of the commons distro.)
I'll try to answer any additional questions you have on this too. Thanks for the input!
--Rob
Comment #2
ezra-g commentedThanks, robertdbailey!
For #2, it's worth noting that Message API does support separate text entry for alternate translation of message partials (rather than the t() ) function. I'm not sure about the extent to which we can/should automate the use of that functionality.
Moving this over to the Commons queue where we can take a look.
Comment #3
devin carlson commentedA patch to take care of #1, #3 and #4 by changing commons_bw_generate_group_widget() to no longer run variables through t() and by customizing the Events menu item as i18n menu will not translate menu items that are not marked as customized*.
*Note that there can be some weirdness around translating exported menu links so you might have to rebuild the menu string text group in order for them to show up for translation.
To translate messages the user must use the Message module's built in translation functionality (the translated sections are caused by token substitution).
Comment #4
ezra-g commentedPatch #3 is committed. Thanks! http://drupalcode.org/project/commons.git/commit/572a335
@robertdbailey, please note that t() is not sufficient for Message translation with activity streams. The reason for this is that the messages themselves have contain a number of tokens whose placement will vary depending on the language. Eg: in English you say "Devin created event X in the Boston group" while in French you say "In the Boston group, Devin created event X."
Moving back to the Lingotek issue queue for comment on whether this is something that Lingotek would consider supporting.
Comment #5
robertdbailey commentedAs a follow-up to conversations we've had on the topic of Message API translation, here is the current plan for handling Message API:
Lingotek is working on a new way to handle translations of all entities. This will take the place of the current content type and comment translation paths, and we are targeting translation of Message-API-related entities too. Message API translation may be more complex than basic entities and could include some additional processing, but we are postponing adding support for Message API translation until the completion of the new way of translating entities.
Comment #6
smithworx commentedComment #7
larryfurr commentedComment #8
robertdbailey commentedUnder Lingotek 7.x-5.x, I am able to get messages translated as separate entities with a little data tweaking. I'm attaching an image showing the translations. These translations are a combination of three processes:
1. The token fields are translated based on existing title-field translation. (worked originally)
2. The group references are translated as built-in strings from a t() function. (worked originally)
3. The additional wording in the message fields are now translated using field translation on entities of type 'message_type' (new)
The data tweaking I did was to set all languages for message types to be the site's default language (English in this case). I am not sure yet why the 'language' field in the message_type table was empty originally, but it needs to be set in order to know the source language to use for the translations.
Would it be possible for Commons to set the language on the message types that are created automatically at install time? If not, I think I could write a utility function to set those at the time the Lingotek module is enabled; but it would be cleaner if the message_type entries were fully built out to include language.
Let me know if this looks like the right direction. Thanks!

Comment #9
robertdbailey commentedMessages appears to be translating correctly based on what I see when installing Commons and stepping through the Lingotek install process. The only extra step is to set a language for the messages that are auto-generated during installation, as the language is not set for these out of the box in Commons. Please review.
Comment #14
smithworx commented