In terms of part of speech, the word 'about' is both a preposition and an adverb (example of the former is 'about us', the latter 'about 50%'). In Drupal and contrib modules, this word often appears as a single string and this makes it impossible to provide an accurate translation for each case without adding context.

All the core modules with an implementaiton of hook_help() use the word as preposition and I assume this will be the case for many contrib modules. For this reason I believe it is reasonable to add context for this particular use.

The patch attached adds context 'hook_help about' to t('About') in implementations of hook_help() in all core modules. (Tested locally to make sure all core modules with an implementation of hook_help() are included and also does not break anything.)

Comments

dokumori’s picture

dokumori’s picture

Version: 7.0-alpha5 » 7.x-dev
zirvap’s picture

Issue tags: +String freeze, +string context

Adding tags

EvanDonovan’s picture

Status: Active » Needs review

How does "context" work? This seems like a good change to make if I am understanding correctly.

Status: Needs review » Needs work

The last submitted patch, translation_context_hook_help_about.patch, failed testing.

dokumori’s picture

@EvanDonovan:

Here's how it works: http://localize.drupal.org/node/2109

Example: http://drupal.org/node/950028

tstoeckler’s picture

Status: Needs work » Closed (won't fix)

The current pattern in core is to use a context if two same words are used in different contexts (which is the case here) and to have the less common one implement the context.
For instance:
"May" (short month name) has no context,
but "May" (long month name) has the context "long-month-name" (or something similar).

In this specific case the "about 50%"-case seems to be the less common one, so it should implement a context. Something like
t('About', array(), array('context' => 'approximation'));
or so. Anyway, all the implementations in hook_help use the more common usage of "About", so they need no context.

Setting to "closed (won't fix)". Please revert, if you feel differently.

dokumori’s picture

Status: Closed (won't fix) » Needs work

@tstoeckler: Thanks for your comment and suggestion, but I am reverting this to 'needs work' and I intend to submit an updated patch.

If one can read and understand Japanese, s/he would notice this problem is quite serious and without the patch we can _never_ translate the string correctly. Contexts can be ignored by other languages if they are irrelevant so applying the patch wouldn't cause any particular issue. However, not applying the patch would definitely degrade the value of Drupal in Japanese market. Just because it's less common doesn't mean the problem does not exist.

Below is the list of where the word 'about' is used (and I'm sure it will grow). I don't think it's realistic to look at every occurrence of the word and apply the context you suggested:

* Drupal core: 7.0-alpha1 (45), 7.0-alpha2 (45), 7.0-alpha3 (45), 7.0-alpha4 (45), 7.0-alpha5 (45), 7.0-alpha6 (45), 7.0-alpha7 (45), 7.0-beta1 (45), 7.0-beta2 (45), 7.0-beta3 (45), 7.0-rc1 (45), 7.0-rc2 (45), 7.0-rc3 (45)
* Pathauto: 7.x-1.0-alpha1 (1), 6.x-2.0-alpha2 (2), 6.x-2.0-alpha3 (1)
* Media: 7.x-1.0-alpha2 (1), 7.x-1.0-alpha3 (1), 7.x-1.0-alpha4 (1), 7.x-1.0-beta1 (1), 7.x-1.0-beta2 (1)
* Porter-Stemmer: 7.x-1.0 (1)
* ProfilePlus: 6.x-2.0-beta2 (1)
* Date: 6.x-2.3 (1), 6.x-2.4 (1), 6.x-2.5 (1), 6.x-2.6 (1)
* Exif: 7.x-1.0-alpha1 (1)
* Re: Comment subjects: 7.x-2.0-alpha1 (1)
* SWF Tools: 6.x-3.0-beta4 (1)
* Conference Organizing Distribution: 6.x-1.0-alpha2 (1), 6.x-1.0-alpha2 (1)
* Drupal for Facebook: 6.x-2.0-beta5 (1), 6.x-2.0-beta6 (1), 6.x-2.0-beta7 (1), 6.x-2.0-beta8 (1), 6.x-2.0-beta9 (1), 6.x-2.0-beta10 (1), 6.x-2.0-beta11 (1), 6.x-2.0-rc1 (1), 6.x-2.0-rc2 (1), 6.x-3.0-beta1 (1), 6.x-3.0-beta2 (2), 6.x-3.0-beta3 (1), 6.x-3.0-rc1 (1), 6.x-3.0-rc2 (1), 6.x-3.0-rc3 (1)
* Wysiwyg: 5.x-2.0 (1), 6.x-2.0 (1), 5.x-2.1 (2), 6.x-2.1 (2), 6.x-2.2 (2)
* Aboutpeople: 6.x-1.1 (1)
* Heartbeat: 7.x-1.0-alpha6 (1), 7.x-1.0-alpha7 (1)
* Image Resize Filter: 7.x-1.9 (2), 6.x-1.9 (1), 6.x-1.10 (2)
* phpEdu Installation Profile: 6.x-1.1-beta5 (1), 6.x-1.1-beta5 (1)
* UberDrupal: 6.x-1.0-alpha3 (1), 6.x-1.0-alpha4 (1), 6.x-1.0-alpha4 (1), 6.x-1.0-alpha5 (1), 6.x-1.0-alpha5 (1), 6.x-1.0-alpha6 (1), 6.x-1.0-alpha6 (1), 6.x-1.0-alpha7 (1), 6.x-1.0-alpha7 (1), 6.x-1.0-alpha8 (1), 6.x-1.0-alpha8 (1)
* Welcoming Websites Wizard: 6.x-1.3 (3), 6.x-1.3 (3), 6.x-1.4 (3), 6.x-1.4 (3)
* Drupal for Churches: 7.x-1.1-unstable2 (45)
* Open Media : 6.x-1.0 (1), 6.x-1.0 (1), 6.x-1.1-beta1 (1), 6.x-1.1-beta1 (1), 6.x-1.1 (1), 6.x-1.1 (1), 6.x-1.2 (1), 6.x-1.2 (1)
* drupal erp profile: 6.x-1.1-alpha3 (1), 6.x-1.1-alpha3 (1), 6.x-1.1-alpha4 (1), 6.x-1.1-alpha4 (1), 6.x-1.1-beta1 (1), 6.x-1.1-beta1 (1), 6.x-1.1-beta2 (1), 6.x-1.1-beta2 (1), 6.x-1.1-beta3 (1), 6.x-1.1-beta3 (1)
* Brochure Site: 6.x-1.0-alpha2 (2), 6.x-1.0-alpha2 (2), 6.x-1.0-alpha3 (2), 6.x-1.0-alpha3 (2)
* Clock: 6.x-1.2 (1), 6.x-1.3 (1), 7.x-1.0-beta1 (1), 6.x-1.5 (2)
* Brainstormblogger system: 6.x-2.1 (2), 6.x-2.2 (2), 6.x-2.3 (2)
* Evaluation API: 6.x-1.0 (1)
* meetü Game Platform: 6.x-1.0-beta1 (1), 6.x-1.0-beta1 (1), 6.x-1.0-rc1 (1), 6.x-1.0-rc1 (1), 6.x-1.0-rc2 (1), 6.x-1.0-rc2 (1), 6.x-1.0-rc3 (1), 6.x-1.0-rc3 (1)
* Profiler Example: 6.x-1.1 (3), 6.x-1.1 (3)
* Explorer 8 Mode: 7.x-1.0 (1), 6.x-1.3 (1)
* Devel Info: 6.x-1.0-rc2 (1), 6.x-1.0-rc3 (1), 7.x-1.0 (1)
* Feeds Test Site: 6.x-1.0-rc1 (1), 6.x-1.0-rc1 (1), 6.x-1.0 (1), 6.x-1.0 (1), 6.x-1.1 (1), 6.x-1.1 (1), 6.x-1.2 (1), 6.x-1.2 (1), 6.x-1.3 (1), 6.x-1.3 (1), 6.x-1.4 (1), 6.x-1.4 (1), 6.x-1.5 (1), 6.x-1.5 (1), 6.x-1.6 (1), 6.x-1.6 (1), 6.x-1.7 (1), 6.x-1.7 (1), 7.x-1.0-alpha1 (45), 6.x-1.8 (1), 6.x-1.8 (1)
* No IE6: 6.x-1.0 (1), 6.x-1.1 (1), 6.x-1.2 (1), 6.x-1.3 (1)
* SiteIndex: 6.x-1.0 (1), 6.x-1.1 (1)
* Sanitizable (formatted text): 7.x-1.0-beta1 (1)
* NodeStream: 6.x-1.0-alpha1 (2), 6.x-1.0-alpha1 (2), 6.x-1.0-alpha2 (2), 6.x-1.0-alpha2 (2)
* NodeStream Core: 6.x-1.0-alpha2 (1), 6.x-1.0-alpha3 (1)
* Hyperlocal News: 6.x-1.0-alpha1 (1), 6.x-1.0-alpha1 (1), 6.x-1.0-alpha1 (2), 6.x-1.0-alpha2 (1), 6.x-1.0-alpha2 (1), 6.x-1.0-alpha2 (2)
* Localized Drupal install profile: 7.x-1.0-beta1 (45), 7.x-1.0-beta2 (45), 7.x-1.0-beta3 (45)
* Simplify: 7.x-1.0 (1), 7.x-1.1 (1)
* Xray technical site overview: 7.x-1.0-beta1 (1)

tstoeckler’s picture

OK, sorry, I think I was unclear.

I had marked this "won't fix" on the assumption that the "about 50%" case, which as I pointed out would need to get a context is not present in core. As I said, the common case "About books" doesn't need a context. So either my assumption is correct, or we do need a patch, but one that is completely the opposite of #1.

tstoeckler’s picture

Also I don't understand the following:

I don't think it's realistic to look at every occurrence of the word and apply the context you suggested:

dokumori’s picture

@tstoeckler: Thanks for your prompt response and clarification. I'm also sorry for not making myself clear.

First of all, in Japanese language, when a word "about" as preposition (e.g. 'about book') is used, the word needs to be accompanied by the actual subject. So for this specific case, my intention is to translate it to 'このモジュールについて' (about this module) or it will not make sense otherwise.

So what I mean by

I don't think it's realistic to look at every occurrence of the word and apply the context you suggested:

is that, the word "about" appears not only in the core, but also in numerous contrib modules. So if we add a context to "about" as adverb (e.g. 'about 50%'), the same needs to be applied to all the modules I've listed in my previous comment (and the list is expected to grow over time). Or else those instances will all be translated to 'About this module'.

Please let me know if my explanation still isn't clear / doesn't make sense.

tstoeckler’s picture

So there are two issues here.

1. Some languages (e.g. Japanese) need a subject for "About". The only way to solve this, is to introduce a hidden replacement, i.e.
change:
t('About');
to:
t('About', array('@subject' => 'Book module'));
Then translators could translate
'About'
with
'this-is-Japanese @subject'
and the subject would appear correctly.
I think such a hidden replacement is unprecedented in core and probably needs more thought.

2. There are two meanings of 'About': 1. 'About a subject or your choice', 2. 'About 2% of all people' (wouldn't 'Approximately' be less colloquial anyway?), so one of them needs a context. Since the latter is much less common, usages of that context need to be identified (so far none have been named, but it has been claimed that they exist in core) and a context such as "Approximation" needs to be added.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.