Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve i18n #99

Closed
3 of 5 tasks
ocean90 opened this issue Oct 22, 2015 · 9 comments · Fixed by #1210
Closed
3 of 5 tasks

Improve i18n #99

ocean90 opened this issue Oct 22, 2015 · 9 comments · Fixed by #1210
Labels
[Type] Enhancement A suggestion for improvement.
Milestone

Comments

@ocean90
Copy link
Member

ocean90 commented Oct 22, 2015

Previously: #16

  • Placeholders aren't explained in a translator comments
  • The use of _n() is wrong in some cases, like _n('One translation rejected.', '%d translations rejected.', $ok, 'glotpress' ), $ok );
  • Strings like __( 'edit', 'glotpress' ) should get a context: _x( 'edit', 'glossary', 'glotpress' )
  • esc_attr( __( ) ) should be esc_attr__( )
  • echo _x( ) should be _ex( )

Note: Each point can have its own PR.

@toolstack
Copy link
Contributor

PR #101 cleans up _n().

This was referenced Nov 6, 2015
ocean90 added a commit that referenced this issue Nov 10, 2015
@shield-9
Copy link
Contributor

Some strings in gp-templates/project-permissions.php would be impossible to be translated into some languages. (For example, Japanese.)

@toolstack
Copy link
Contributor

Could you provide an example of what can't be translated?

Items like the slug, username, login id, etc. aren't translated as they shouldn't be.

@shield-9
Copy link
Contributor

@toolstack: Japanese has quite different sentence structure. In this case, word order is the problem. Here's an example:

  • English: user <a href="{user_nicename}">{user_login}</a> can {action} strings with locale {locale_slug} and slug {set_slug}
  • Japanese: ユーザー <a href="{user_nicename}">{user_login}</a> はロケール {locale_slug} で、スラッグ {set_slug} の文字列を {action} できます

@toolstack
Copy link
Contributor

@shield-9 take a look at #188, would that work better?

@ramiy
Copy link
Contributor

ramiy commented Jan 7, 2016

See also https://github.com/deliciousbrains/GlotPress/pull/198

Merge similar strings with different variations and avoid using HTML <code> tags in translation strings.

@pedro-mendonca
Copy link
Member

pedro-mendonca commented Sep 11, 2017

Hi @ocean90

I have some suggestions to improve i18n.

  • Merge the following Priority labels (have commit):

  • Priority of the original:

  • Priority:

  • Move arrows outside of the following strings and merge similar (have commit):

  • Project actions &darr;

  • Project actions &uarr;

  • Personal project options &darr;

  • Personal project options &uarr;

@pedro-mendonca
Copy link
Member

Hi @ocean90,
Regarding the above item:

  • Strings like __( 'edit', 'glotpress' ) should get a context: _x( 'edit', 'glossary', 'glotpress' )

Did you mean the __( '(edit)', 'glotpress' ) used for Glossary, Project and Translation set?

There are also these two, that I believe you weren't refering to:
__( 'Edit', 'glotpress' ),
__( 'Delete', 'glotpress' ),

@pedro-mendonca
Copy link
Member

I'll post here another I18n issue that occurs in many pages:
imagem

The action links aren't separated with a space.
This would be easily fixed as below:
Current code example:
return gp_link_get( gp_url( gp_url_join( '/glossaries', $glossary->id, '-edit' ) ), $text, gp_attrs_add_class( $attrs, 'action edit' ) );

Fix with prepend empty space on add custom text link:
return gp_link_get( gp_url( gp_url_join( '/glossaries', $glossary->id, '-edit' ) ), ' ' . $text, gp_attrs_add_class( $attrs, 'action edit' ) );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants