Very many strings in Commons are defined/set on a Page (Panels) or in a View. This means that if you enable the Locale module and import translations for your language, many strings (which has translations) will stay unchanged. There needs to be a standard way to handle this. If not, Commons can't really support other languages than English.
Some mentioned i18nviews, but is it useful? There is only a dev release from July 2012. Is there something similar for Pages?
In addition, some strings in Views are already translatable (like "Recent site activity") while others aren't. Confusing.
Are there any plans to improve the situation?
Comments
Comment #1
hansfn commentedHm, maybe something like i18nviews isn't needed after all. It seems all the titles in Views are translatable, you just have to clear the cache to make the translations appear. Great!
PS! I haven't remove Views from the issue title yet since there might be other issues.
Comment #2
devin carlson commentedI'm marking this as a duplicate of #1933672: Include I18N and L10N in Commons download which discusses including internationalization/localization modules with Commons. Otherwise, Commons isn't doing anything special to help/prevent you from translating/localizing content.
Internationalization Views takes care of a bunch of edge-case text that sometimes needs to be translated. It's cousin is currently a sandbox, titled i18n Panels which attempts to integrate Panels with Internationalization.
Comment #3
hansfn commentedI'm testing Drupal Commons 3.4 and this can stil be improved. Example:
The string 'Recent content' defined in commons_groups/modules/commons_groups_pages/commons_groups_pages.panelizer.inc (line 408) is still not available on localize.drupal.org however I can translate it directly in my Drupal.
Is this a panelizer bug/feature or can it be fixed in Drupal Commons?
Comment #4
devin carlson commented@hansfn Localize.drupal.org uses translation template extractor to find text used with the Localization APIs, and makes those available for community translation.
Translation template extractor only works with specific function calls (t(), watchdog(), etc) and is not compatible with user-created content such as nodes or panels. This is why you won't see strings for things like node titles ('How to create a veggie burger') on localize.drupal.org.
It may be possible to add a static list of "translatables" to exported panels, similar to exported views, which would get picked up by translation template extractor. I'd suggest searching the Panels module issue queue and filing an issue if you don't find a similar request.
Comment #5
hansfn commentedThx for the long reply. I should have told you that I have translated open source programs for years. (I have also written the translation code for a CMS/blogging software so I know a lot about gettext.)
Anyway, I don't think you should close this issue, because I was wrong - you can't even translate the string I pointed to. In addition, isn't the fix as easy as:
Greping through the source code I see some more instances of override_title_text without a call to t(). Maybe some of them should be altered in the same way?
Comment #6
hansfn commentedSorry, but I'm reopening this (again).
On example.org/groups, example.org/events and example.org/activity the page title (h2) stays untranslated.
I guess these strings comes from
If I add a call to t() around the value assigned to $display->title, it seems to fix the page titles, but maybe the correct approach is using something like "translatables" in exported views? I guess the latter is what you talked about when you asked me to look in the Panels issue queue? Maybe #1179034: Translatable panel titles: Implement i18n_strings is what we need?
I just think this is so important that it should be
fixedhacked in Commons. These are the most central pages and having the page titles in English isn't what you want ...Comment #6.0
hansfn commentedUpdated issue summary.
Comment #7
devin carlson commentedThe i18n_panels module has now been added to Commons (#2145229: Add i18n Panels module) which implements
i18n_strings()on behalf of Panels (until #1179034: Translatable panel titles: Implement i18n_strings is fixed) so that you can now translate pages as you can views.