Posted by aturetta on February 2, 2012 at 4:17pm
5 followers
| Project: | Address Field |
| Version: | 7.x-1.x-dev |
| Component: | User interface |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
The standalone word state is used in various module as the label of a status column or such.
I think it's fair to assume the number of uses of the word State as an administrative area is much lower, so the context identifier needed to disambiguate should be put there.
| Attachment | Size |
|---|---|
| patch-addressfiles-state-context.patch | 1.11 KB |
Comments
#1
Your patch throws errors because your context is not in the format that t() expects it to be. Here is an updated patch.
#2
please commit
#3
Works for me.
However, some context naming guidelines would be nice to be declared. We could use similar context as field module does:
For example:
#4
Curious... 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...
#5
Sorry, 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
#6
Not 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?
#7
Nonono... 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!
#8
found it http://drupal.org/node/1369936
#9
Alternative proposals would be most welcome. "Part of a postal address," perhaps?
#10
This 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.
#11
So 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.
#12
The 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.
#13
Tell 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.
#14
Ryan, 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).
#15
Yep, thx.
This would not help understanding the string either :-)
#16
@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. :-/
#17
Your 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.