Wp-calypso: Purchases: String 'Manage Purchase' is not localized

Created on 26 Jul 2016  路  3Comments  路  Source: Automattic/wp-calypso

Steps to reproduce

  1. Starting at URL: https://wordpress.com/purchases
  2. Go to the purchased plan
  3. See the title on the top, 'Manage Purchase'.
  4. Switch to another interface language and verify step 3 again.

    What I expected

The string 'Manage Purchase' is translated to user's interface language.

What happened instead

The string 'Manage Purchase' is not translated to user's interface language.

Browser / OS version

Chrome 51.0.2704.103 (64-bit) / OSX 10.11.14

Screenshot / Video

screen_shot_2016-07-26_at_11_14_14_am

Interface language set to 'es'.

Purchases [Type] Bug good first issue i18n

Most helpful comment

Defining a context in this way doesn't work.

When we extract strings for translation, we are looking just at the raw js text file, we don't run JavaScript (it would be too complex). So for that reason the string gets added to GlotPress without a context (no grey box with white text next to the original) but when we ask for displaying the string, a context is provided Title text, hence no translation with that context can be found.

Two possible solutions:

  • Remove the context, i.e. L6 (preferable in this case)
  • add the context verbatim in each line (will require a full translation cycle: extract new string to GlotPress, send for translation next week, get string back and deploy)

All 3 comments

It does seem like the string is translatable (see) and that there is a translation available for es (see).

@akirk could you take a look and check if that string has been deployed already? Or maybe there's some other reason why the translation isn't showing?

Defining a context in this way doesn't work.

When we extract strings for translation, we are looking just at the raw js text file, we don't run JavaScript (it would be too complex). So for that reason the string gets added to GlotPress without a context (no grey box with white text next to the original) but when we ask for displaying the string, a context is provided Title text, hence no translation with that context can be found.

Two possible solutions:

  • Remove the context, i.e. L6 (preferable in this case)
  • add the context verbatim in each line (will require a full translation cycle: extract new string to GlotPress, send for translation next week, get string back and deploy)

cc @gziolo who created this code.

In general, context is like commas in English: when in doubt, leave it out. Context is only needed if it shows that the same text needs to be translated differently in two locations of our UI, depending on the _context_. I know that adding context is well-intentioned but if you want to help the translator (and that is very much appreciated!), please use a comment.

Was this page helpful?
0 / 5 - 0 ratings