Closed (fixed)
Project:
Address Field
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Feb 2012 at 16:17 UTC
Updated:
27 Nov 2013 at 16:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
helior commentedYour patch throws errors because your context is not in the format that t() expects it to be. Here is an updated patch.
Comment #2
xandeadx commentedplease commit
Comment #3
imiksuWorks for me.
However, some context naming guidelines would be nice to be declared. We could use similar context as field module does:
For example:
Comment #4
rszrama commentedCurious... I thought I updated this issue earlier when I made the commit. I guess it didn't save... in any event, I added a simple "addressfield" context, as I think when I read the documentation that the context should function more like a general taxonomy term for a realm of strings than a description of the string in question - I think we got this wrong in Commerce itself. C'est la vie.
Commit: http://drupalcode.org/project/addressfield.git/commitdiff/1ac0256fb924ef...
Comment #5
hass commentedSorry, but a "context" should explain the meaning of the string not a module name. Otherwise translators cannot translate it properly without looking into module code where a string is used e.g. Territory of a country.
http://en.wikipedia.org/wiki/State
Comment #6
rszrama commentedNot according to http://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/t/7. It simply says the string should be "The context the source string belongs to." That doesn't sound like a meaning / explanation to me, and without further documentation on the topic, I'm not inclined to be more verbose. Do you have any links to better examples / explanations?
Comment #7
hass commentedNonono... This is api doc not translation docs. My example is good. Core has such an example, too.
How should I know as translator ***what*** You mean with this context. This is not the way how this need to be written. Looking for the doc link. May take some time. Keep in mind translators may not use your module. They only see the string, nothing else!
Comment #8
hass commentedfound it http://drupal.org/node/1369936
Comment #9
rszrama commentedAlternative proposals would be most welcome. "Part of a postal address," perhaps?
Comment #10
hass commentedThis does not sounds very good to me. The context should describe what the string means and not where it's also shown. My suggestion sounds usefull and could also used by other modules as it's not module specific, too.
Comment #11
rszrama commentedSo you don't think seeing "State, part of a postal address" is enough to help a translator know how to translate a word? Again, we're looking to just make sure translators know how a string is used, not define the word. This context has the additional benefit of being useful for other parts of the postal address if we need to add a context to them.
Comment #12
hass commentedThe word "state" can be used in other situations like a map, too. It's not necessarilly part if an address field. The context's used in commerce packages are one of the worst examples for context usage. Don't write it this way, please.
Comment #13
rszrama commentedTell me about it. That's what I'm trying to avoid by not aiming for a definition but describing the context in which the string is used. Honestly, looking at the context list that documentation page links to, just about everyone else has simply been using their module name.
Comment #14
aturetta commentedRyan, you need to think about SEMANTIC context, not programming context.
The translator will see 'State' as original string, what it misses is 'Are we talking about a geographic entity or not?'
That's the meaning of context.
Please consider using a generic context that can be reused in most places where it applies. So lot of different strings with a 'geography' context are more appropriate than a dedicated context that's valid only for a single string (in particular, I see no need to repeat the word to be translated inside the context string).
Comment #15
hass commentedYep, thx.
This would not help understanding the string either :-)
Comment #16
rszrama commented@aturetta The semantic context is its use in relation to being part of a postal address. That was my recommendation above, and it has nothing to do with the code. :-/
Comment #17
hass commentedYour example makes it impossible to reuse the string in other context where it's not part of an addressfield. A State can be used in many situations and I do not like to translate it 100 times just for the reason that you write once; part of an addressfield; part of a map; blah blah blah... With my context suggestion we can use it for all of these.
Comment #18
hass commentedHow about committing my recommended fix now? Territory of a country
Comment #19
xibun commented2 more ideas:
federated state (ok, repeating state.. but maybe more clear then next one)
federated unit (see column header here: http://en.wikipedia.org/wiki/Federated_state)
Comment #20
hass commentedSounds not good to me. If you "explain" something you should not use the same words as it confuses the same way. Use other words.
Comment #21
xibun commentedfederated unit doesn't repeat the word "state"
(and I don't think this is about "explaining" I think it is about "disambiguation")
Comment #22
hass commentedPatch attached.
Comment #23
imiksuJust wondering, but is it common to update translations on update hooks (especially when changing context)?
#22 patch would cause an existing translation to get thrown away.
Comment #24
hass commentedNo. Post release you need to translate on l.d.o and reimport translations e.g with l10n_update.
Yes, an invalid translation reverts to english. This is as designed.
Comment #25
rszrama commentedHonestly, I'm not sure it's worth breaking existing translations to update this, but so the context might be used by other modules, I'll make the change now - better in a beta than a final release. hass, any chance you can convince other relevant modules to use the same translation context string?
Commit: http://drupalcode.org/project/addressfield.git/commitdiff/cbaab93
Comment #26
hass commentedI will try to identify them :-). Thx.
Comment #27
aturetta commentedThanks Ryan!