Closed (fixed)
Project:
User Relationships
Version:
6.x-1.0-rc2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 May 2009 at 15:56 UTC
Updated:
21 Feb 2011 at 08:32 UTC
Jump to comment: Most recent file
Comments
Comment #1
alex.k commentedPlease post screenshots. Thanks.
Comment #2
brainski commentedThats true. I'm not able to translate it as well:
F.ex.
"Become username's friend" in Relationship Actions Block is not translatable.
Comment #3
alex.k commentedHmm it sounds like 'friend' is what you have called your relationship type... in that case that is probably not translatable, you are right. The options are:
* If this is your only type defined, then translate "Become %name's %rel_name" which is used in
function theme_user_relationships_request_relationship_direct_link(&$relate_to, &$relationship_type)* If it isn't, override this function in your theme to output proper link titles...
This behavior is rooted pretty deeply in UR so ideas on how to apply translation across the board are welcome.
Comment #4
aufumy commentedAdded some t() 's around the display of the relationship type.
Comment #5
alex.k commentedVery nice, thank you!
Could you just also translate the plural names where given:
to
A parallel question, a reality check more than anything... would it make sense to use another text group for translating relationship names? Similarly to how menus, block titles, etc are different from the "built-in interface" text group. This will help disambiguate some names like 'parent' which can be seen as verbs or nouns out of context.
Comment #6
aufumy commentedThat makes a lot of sense, to use a different group.
Will do.
Comment #7
aufumy commentedThis patch:
* implements hook_locale() in user_relationships_ui.module to define a new group
* uses function tt() from i18nstrings module to get the translated strings from the right group
* implements a degrade path if i18nstrings module is not enabled.
Comment #8
alex.k commentedGreat stuff, thank you!
Comment #9
aufumy commentedCommitted the following patch to branch DRUPAL-6--1
Comment #10
aufumy commentedA few more missing tt()'s committed to cvs
Comment #11
kars-t commentedThe patch itself is a great thing but please think about this:
Even if this might be a good idea what will happen if all modules that want to use tt() do this?
I don't think it is wise to do this!
Maybe provide a real wrapper like
This review is powered by Dreditor.
Comment #12
aufumy commentedI like that this uses a static variable instead of calling
module_exists('i18nstrings')andfunction_exists('tt').However, if one uses
if (! module_exists('i18nstrings') && ! function_exists('tt')) {then the case that other modules may follow suit could be avoided.
What I like about using module_exists/function_exists way, is that when i18nstrings module is enabled, there is no extra layer of each module instantiating their own function, and each time contribmodule_tt() is called to go through the processing each time.
Thoughts?
Comment #13
kars-t commentedI think that
! function_exists('tt')is a good idea and less work if you don't want to add a real wrapper. Performance wise I don't think there will be a difference. I feel a wrapper is cleaner but just decide what you want to use :)Comment #14
Scott Reynolds commentedI like this approach. You do NOT need the static $i18nstrings as module_exists() already does a static cache for you.
This is helpful yet a little short...
http://drupal.org/node/304002
Comment #15
aufumy commentedAlright, I see the light now. If there is a poorly written tt() function from a contrib module with a lower weight, this would cause problems for every other contrib module that calls tt() when i18nstrings is not enabled.
Comment #16
aufumy commentedComment #17
alex.k commentedGreat work, thanks for the patch and the reviews!
Comment #18
aufumy commentedCommitted to cvs DRUPAL-6--1, thanks to Kars-T, Scott Reynolds and Alex.K!
Comment #19
aufumy commentedComment #21
aufumy commentedKars-T, Scott, if you can pipe in on a related similar issue
http://drupal.org/node/606804
Thanks
Audrey
Comment #22
Gabriel R. commentedWith RC3 the User Relationships PO is empty.
Existing strings are not there, new ones added just to try out the translation are not there either.
Dare I reopen this issue?
Comment #23
alex.k commentedTranslations have been reorganized by d.o translators into respective modules. So they are no longer all together in user_relationships_api. Can you confirm if that's the case for you?
Comment #24
guillaumev commentedHi,
I'm trying to translate my 'friend' relationship to 'amigo' in Spanish. I was able to translate 'friends' (plural) to 'amigos', because it appeared in the list of the strings to be translated, however 'friend' (singular) does not appear when I search for it in the translation interface. How can I translate my relationship name ?
Thank you.
Comment #25
guillaumev commentedHi,
Following http://drupal.org/node/789286, I created a patch which adds the user defined strings to the i18nstrings module using i18nstrings_update. So, if you want to translate your 'friend' or whatever relationship to another language:
Comment #26
YK85 commentedComment #27
ayalon commentedI have tested patch #25 and it is RTBC.
I had to implement this patch in a live system, because it is not possible to translate relationship names if you change the name of a relationship.
This patch fixes the missing functionality and enables you to translate the name of the relationship. String are updated.
Thanks for this patch!
Please bring this issue to an end and commit #25. Thanks.l
Comment #28
alex.k commentedRefactored into a function to avoid duplication, committed in http://drupal.org/cvs?commit=420356. Thanks!
Comment #30
verynic commentedsubscribing