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

People: Properly translate role based strings #138

Closed
v18 opened this issue Nov 18, 2015 · 0 comments
Closed

People: Properly translate role based strings #138

v18 opened this issue Nov 18, 2015 · 0 comments

Comments

@v18
Copy link
Contributor

v18 commented Nov 18, 2015

We display role based strings in a few places in the accept invite flow, and we'll need to make sure that these are able to be translated properly.

Example: "Sign up to become an editor on Busy Mom Confessional?"

We need to properly build that string so that it returns returns a or an for English. Ex. - an editor or a contributor.

My guess is that we should switch on the role, and then for the ~5 roles that we would expect, we should return a translated string specific for that role.

ex.

let text = '';
switch ( role ) {
    case 'administrator':
        text = this.translate( 'Sign up to become an Admin on...' );
        break;
    case 'editor':
        text = this.translate( 'Sign up to become an Editor');
        break;
    case 'author':
        text = this.translate( 'Sign up to become an Author');
        break;
    case 'contributor':
        text = this.translate( 'Sign up to become a Contributor');
        break;
    case 'subscriber':
        text = this.translate( 'Sign up to become an Subscriber');
        break;
    default:
        text = role;
}

return text;

cc @yoavf for advice on if the switch above is a reasonable approach.

Another example of strings that we'll need to properly translate is the invite header. Based on roles, we'll want to create strings such as:

let text = '';
switch ( role ) {
    case 'administrator':
        text = this.translate( '%(user)s invited you to administer %(blogname)s' );
        break;
    case 'editor':
        text = this.translate( '%(user)s invited you to edit %(blogname)s' );
        break;
    case 'author':
        text = this.translate( '%(user)s invited you to author on %(blogname)s' );
        break;
    case 'contributor':
        text = this.translate( '%(user)s invited you to contribute to %(blogname)s' );
        break;
    case 'subscriber':
        text = this.translate( '%(user)s invited you to subscribe to %(blogname)s' );
        break;
    case 'follower':
        text = this.translate( '%(user)s invited you to follow %(blogname)s' );
        break;
    default:
        text = role;
}

return text;

To be honest, some of those string feel weird. Perhaps we can reword them? Also, we may be able to draw some inspiration for wording from the invitation emails.

cc @rickybanister for thoughts on wording

@v18 v18 added this to the People Management: m6 milestone Nov 18, 2015
jsnajdr pushed a commit that referenced this issue Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants