Hello,
I'm trying to translate Drupal Commons. Nonetheless, it seems that I can't translate some strings.
1 - On groups page directory (/groups), I can't translate "Recent content" to "Contenu récent". There is a string "Recent content" that I can traduce in .po file, but modification doesn't work (only for the view name called Recent content).
2 - On group page (/groups/blabla), I can't translate "Create a post", "Create a document", "Create a Wiki", "Create a Poll", "List an event". There is no string related in po translation file. Nevertheless, for "Ask a question" button, it's okay ("Poser une question", in French) !
3 - For all content, under the node title, I can't translate "Post created by XX ...". It's okay for "created by". Nonetheless, there is no string to translate for node content type as "Post", "Poll", "Answer", even if I modified the name of content in content types administration. "Question", "Document" and "Wiki" are okay because it is the same names in French. But it is the same problem.
How can I translate these missing strings ?
PS : Sorry for my bad English ;)
Thanks a lot for Commons. It's an amazing application !
H. Servaes.
Comments
Comment #1
japerryComment #2
mailfox CreditAttribution: mailfox commentedSee #1 views
Is there a solution to translate # 2?
#3 admin/structure/types and admin/config/regional/translate/translate
Comment #3
mailfox CreditAttribution: mailfox commentedsolution to translate # 2 here
Comment #4
jpontani CreditAttribution: jpontani commentedFor the browsing widget, each button is added via an implementation of hook_commons_bw_create_all_widget in corresponding modules (ie commons_events provides the link for 'List an event', and it is currently untranslated).
The fix is to patch each content type module (events, wiki, posts, poll, q&a) and wrap the link text in the hook implementation in the translate function.
Comment #5
mailfox CreditAttribution: mailfox commentedSo who will make the patch? I solved the problem ... but what about the others?
Comment #6
morphay CreditAttribution: morphay commentedin 3.1 i could not translate messages in "admin/structure/messages" but in 3.0 it's worked, anybody can help?
upd: i added messages for other language whith "admin/config/system/message/text-copy" and translated them in "admin/structure/messages"...
Comment #7
japerryI've committed the changes to #2 -- we should have this fixed now if you update to the dev version of commons.
http://drupalcode.org/project/commons_wikis.git/commit/283f57d
http://drupalcode.org/project/commons_documents.git/commit/bc0f3c0
http://drupalcode.org/project/commons_posts.git/commit/03806fc
http://drupalcode.org/project/commons_polls.git/commit/c3bb7c7
http://drupalcode.org/project/commons_q_a.git/commit/98f7f98
Comment #8
jpontani CreditAttribution: jpontani commentedMissed a link in Wikis, committed here: http://drupalcode.org/project/commons_wikis.git/commitdiff/b763bae
For the translation issue #1 (Recent content), http://drupalcode.org/project/commons_groups.git/commitdiff/9aa600a
For the translation issue #3, Commons Origins has that text wrapped in t() already, and the node types should be available for translation, as the export for for hook_node_info() in each content type module has the name wrapped in t() as well, ie (some code trimmed to save space):
Comment #9
japerryoh thanks for caching that. Marking as fixed!
Comment #10
morphay CreditAttribution: morphay commentedbut what about post #6 ? it is also not translated in 3.2
Comment #11
Antoine_k CreditAttribution: Antoine_k commentedIn the Commons Events submodule, the string "attendees" is not properly defined for translation in the commons_events/includes/commons_events.forms.inc file.
Line 34 should be modified this way:
'#markup' => format_plural($attendee_count, '1 ' . t('attendee'), '@count ' . t('attendees')),
Best regards!
Comment #12
jpontani CreditAttribution: jpontani commentedThe code and documentation for format_plural() has it already calling t() inside the function itself, so there is no need to pass it already localized strings.
And the corresponding code (only showing the returns that the function has):
Comment #13
Antoine_k CreditAttribution: Antoine_k commentedI finally could fix it on my site (after hours)!
It has to do with the language configuration of your site.
Indeed, for me, all strings were set for "Undefined language" ([und]) but not for English and French. And I didn't understand how it works.
I had to go to admin/config/system/message/text-copy and copy all strings form "Undefined language" to "English" and other languages.
After that, I could modify the text strings in admin/structure/messages editing the entries I wanted to modify.
And it works now (think of clearing your cache after that) ;-)
Comment #14
Antoine_k CreditAttribution: Antoine_k commentedThanks for your reply, but it didn't work for me, I really had to hack the core module... (I had already translated "attendee" and "attendees" and it wasn't displayed in my language)
Comment #15
morphay CreditAttribution: morphay commentedyou have a Drupal Commons 3.2?
Comment #16
Antoine_k CreditAttribution: Antoine_k commented@morphay, yes my version is 3.2. Don't you have the same display on yours?
Nevertheless, I still have a string I can't translate:
it's a block title in user profiles: the title of the "Groups a user contributes to" view block is "Groups user_first_name contributes to" and I don't find the way to solve this :-/
Could anyone help me?
Thanks in advance!
Comment #17
japerryAntoine_k, that issue is views related. Take a look at 'commons_groups_user_groups' -- it should be the title for that.
I'd suggest using i18nviews, even though d7 is in dev only right now.
http://drupal.org/project/i18nviews
Comment #18
hansfn CreditAttribution: hansfn commentedRelated issue with work-around for translating activity stream - #1968238: Translation of activity stream / messages. (It's the same work-around as reported above several times with a little twist.)
Comment #19
hansfn CreditAttribution: hansfn commentedIn commons_events/commons_events.features.field_base.inc there are multiple strings that aren't translatable. At least they don't show up on admin/config/regional/translate/translate ... Some example:
Reading #1827816: Add Title module it seems this should have worked.
PS! Please tell me if I should open a new issue.
Comment #20
hansfn CreditAttribution: hansfn commentedOK, this isn't part of the Events component, but maybe keeping these translation issue in the same thread is useful?
See user/UID/notification-settings for all the troublesome strings.
Comment #21
hansfn CreditAttribution: hansfn commentedOne more problem related to "override_title_text" used in Pages and Panelizer ... For example "Recent content" in ./commons_groups/modules/commons_groups_pages/commons_groups_pages.panelizer.inc and "Groups %user:field_name_first contributes to" in ./commons_user_profile_pages/commons_user_profile_pages.pages_default.inc doesn't seem to be translatable.
Comment #22
hansfn CreditAttribution: hansfn commentedThere are some issues with plural handling in the views. The attached patch fixes these for the upcoming events view (commons_events_upcoming).
Comment #23
ezra-g CreditAttribution: ezra-g commentedMarking as "needs review" per #2.
Comment #24
victoria_b CreditAttribution: victoria_b commentedHi,
A few weeks back I tried to translate "Organizer" and "Organizers" to "Organiser" and "Organisers". It didn't work.
Could this be fixed too?
Thank you.
Comment #25
Devin Carlson CreditAttribution: Devin Carlson commentedThe issue mentioned in #2 was solved with the commits in #7. The other translation problems mentioned in this issue have been fixed in -dev or require translation modules which are not included with Commons (ex i18n_views).
Marking this as fixed. Please try upgrading to the latest -dev release of Commons (or waiting for the stable 3.3 release) and checking if your issue(s) have been fixed. Any new or continuing problems should be filed as new, separate issues.