Closed (fixed)
Project:
Project
Version:
5.x-1.x-dev
Component:
Projects
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
1 Aug 2008 at 20:38 UTC
Updated:
30 Jan 2009 at 16:40 UTC
Jump to comment: Most recent file
Here is patch to fix many translatable strings to be more consistent with core, more context sensitive (this part needs nevertheless more fixes - for e.g in class project_views_handler_filter_project_type_vid), fixes some missing periods and missing words, etc.
Both patches apply are against aclight's SYN.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | D6_project_translatable_strings_review_2009011301.patch | 18.56 KB | hass |
| #12 | D5_project_translatable_strings_2009010701.patch | 11.53 KB | hass |
| #11 | project_d5_translatable_strings.patch | 11.53 KB | hass |
| project_d6_translatable_strings.patch | 16.04 KB | hass |
Comments
Comment #1
hass commentedComment #2
aclight commentedAs I said over in #157694: Upgrade project module to 6.x, let's get this fixed in the D5 version first.
Comment #3
dwwAgreed, let's fix these strings in D5. Thanks.
One quick thing I noticed skimming the patch:
A) that puts the look and feel of your site in the hands of the translations, not the themer, which seems wrong. % == theme('placeholder'). Maybe on my site, I like to make my placeholders bold, not italic. So, I implement my own theme_placeholder(), but now the German translation put some placeholders in em. I thought it was always a bad idea to have raw HTML in translatable strings.
B) Your way also means that you then have to translate "Download link base URL" both inside this string, and where it separately appears. That's why I'm in the habit of referring to UI elements that are already translated elsewhere via placeholders, so that you only have to translate the name once. Saves time for translators (I thought) and improves consistency (so the setting name is forced to always be translated the same way everywhere it appears).
But, I'm not a translator ;) so if you have another explanation, I'd be interested in hearing it.
Cheers,
-Derek
Comment #4
hass commentedWe could write
t('The "Download link base URL" should end with a slash.')to solve the theme placeholder issue. No problem.See http://api.drupal.org/api/function/t/6 about example of incorrect usage of t(). It explains that the string shouldn't be moved outside the main string. If we do this we will end up with context insensitive strings what could make more headaches... nevertheless it looks like a "reusable" string. It could simply break other things...
Comment #5
dww",<em>and<strong>(among others) are all possible placeholder delimiters a themer might want to use. I don't see how putting this in the hands of the translators is ever a good idea. That's part of the point of %foo being automatically run through theme('placeholder') for you.That API comment makes sense for links, since the link title wants a little context along with the rest of the sentence you're translating. However, it seems that if "Download link base URL" is already a t()'ed string when it appears directly in the UI, then the argument about "context insensitive strings" doesn't count. You already have to translate "Download link base URL" on its own, without any other context, since it's the title of some form element. Given that, I don't see why it's an improvement to have to translate it N times: every occurrence of the name of that form element in help text, etc. It really is just a placeholder as far as the help text is concerned.
Could you provide a little more evidence/explanation of "It could simply break other things..."? I don't see how.
Thanks,
-Derek
Comment #6
hass commented<em>in strings seems to be ok, see http://drupal.org/node/194962#comment-1065964Comment #7
dwwTo quote the comment you just linked:
This is markup to delimit a placeholder, the name of another setting, so this falls under Gabor's definition of "indeed a bad idea". And, as usual, you haven't replied to my other points or questions. ;)
Comment #8
hass commentedI have asked in the comment http://drupal.org/node/194962#comment-1065924 point 3 about the change
t('The <em>Download link base URL</em> should end with a slash.')and he answered that EMs are ok in such a case... let's aks Gabor about your above detailed questions... I understand well what you mean above, but I have no real solution how we should handle this for future... :-)Comment #9
hass commented#B is easy to answer... the main problems coming up here are context sensitive strings. Yes we may need to translate one string twice or more often, but if you need to know what the meaning of the placeholder is you are lost if there is only a variable. You cannot say if the string is male/female/it and so... this is very important for translators. Different languages have different rules... :-)
Comment #10
gábor hojtsydww: re #3: I see your points in consistent placeholder markup/design and consistent translations for UI elements. Unfortunately some languages (might) need to add suffixes to the UI labels when they appear with a sentence. For example, in Hungarian "with something" translated to a "-val" or "-vel" suffix on the something, that is the corresponding form to the "with" word. So although we could translate in a style like "you can save it using the %name button" (so that we avoid "with" and therefore the suffix on the word), but it is twice as long and is not at all natural to Hungarian readers. The Localization API guide we recently put together documents that unnecessary markup should be removed from t(), but when you remove actual text at the same time, it could easily hurt translations. It might not make it impossible to translate (such as this case, when you refer to a button name, not moving out part of the sentence flow even in the English original), but it does make it harder and the translations more uglier.
Comment #11
hass commentedRoled patch for D5.
Please leave some time to update translation files before 1.3 release.
Comment #12
hass commentedChasing... no code changes, only lines have changed.
Comment #13
hass commentedAny way to get the above D5 patch committed or the D6 first and then the D5?
Here is a re-role of the D6 patch.
Comment #14
dwwA) This breaks the spacing between sentences:
I replaced it with this (a single t() seems better now):
B) What's the problem here?
I thought stuff like
<none>was the standard formatting for select elements like this... Are there examples in core of- None -like you've got it?C) The D5 patch broke some functionality by using the D6 API for url():
In D5, that needs to be:
D) The D6 patch didn't apply cleanly, so I had to resolve conflicts.
E) I know t("Don't mess") is better than t('Don\'t mess'), but why do you care if it's t("Something") or t('Something') when there's no escaping involved?
After reviewing and testing, fixing the above, and leaving out the hunk from (B), I committed to HEAD and DRUPAL-5.
Thanks for helping,
-Derek
Comment #15
hass commentedA) Ok.
B) Yes in core, CCK started using it, but I'm not sure if there is a general rule for this.
C) Sounds like a backporting bug as I applied the D6 patch to D5, fixed all hunks and forgotten about this API change. Sorry.
D) last time I made it - it worked for me. Maybe the last changes broke it.
E) This is a code style fix. It's written somewhere that we should not use double quotes - if not really required.
Comment #16
gábor hojtsyOn B: core does use
<none>as expected input for stuff, but is it not translated. Whatever language you are in, you are expected to enter<none>. Otherwise core uses- Please choose -and other similar constructs. Latest versions of Drupal 6 and 7 whitelist allowed HTML tags in translatable strings, and<none>is not among the allowed tags (neither is<select a project>). So if you are using HTML tag looking text in translatable strings, you should at least escape them. I'd say better standardize on stuff which does not look like HTML tags.Comment #17
dww@Gabor: thanks for the input, that makes sense.
I'll apply the last hunk to both branches when I have the chance.
Comment #18
dwwThere was a spot in project_release that was using
<none>for a similar project selector drop-down, which I fixed, too. Committed both to HEAD and DRUPAL-5.Comment #19
hass commentedAside,
- Please choose -is also much easier to translate then single word strings like "none" - a least in German... THX.