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

Translation of Tags #527

Closed
amdad opened this issue Sep 20, 2015 · 16 comments
Closed

Translation of Tags #527

amdad opened this issue Sep 20, 2015 · 16 comments

Comments

@amdad
Copy link

amdad commented Sep 20, 2015

We already have in English

 discussion_tagged_post:
    one: "{username} {action} tag."
    other: "{username} {action} tags."
  added_tags: "added the {tags}"
  removed_tags: "removed the {tags}"

Unfortunately, strings logic in sentence is too strict. I've tried in many ways, but I cannot form correct phrase in my language with this.

I need pluralization for {action} part.

It would be like:
Of course this is not English grammar/logic. Just example of structure in my localization.

 discussion_tagged_post:
    one: "{username} {action}."
    other: "{username} {action}."
  added_tags:
    one: "add tag {tags}"
    two: "add tags  {tags}"
    other: ...
  removed_tags:
    one: "remove tag {tags}"
    two: "remove tags  {tags}"
    other: ...

Edit : Removed whole first proposed solution.

@amdad
Copy link
Author

amdad commented Sep 20, 2015

Oh, after a while of thinking first solution would be too messy. So I left only second solution as proposal of solution.

@tobyzerner
Copy link
Contributor

Gotcha, looks doable. Pinging @dcsjapan in case he has any thoughts.

@amdad
Copy link
Author

amdad commented Sep 20, 2015

Uff, nice to hear it's not too big problem.

Please remember about Gender plugin and translation support. It's really needed here. Should I create another issue for this? Anytime soon?

@tobyzerner
Copy link
Contributor

Another issue would be good. We'll try and get it in within a few weeks.

@dcsjapan
Copy link
Contributor

Pinging @dcsjapan in case he has any thoughts.

Thanks @tobscure ... of course I haven't looked at the Tags extension at all yet, and am still trying to get up to speed on YML. But I wondering if it's really necessary to move the "tags" out of the first string.

Would this sort of thing be possible?

discussion_tagged_post:
    one: "{username} {action} tag."
    other: "{username} {action} tags."
  added_tags:
      one: "added(sing) the {tags}"
      two: "added(dual) the {tags}"
      other: "added(plur) the {tags}"
  removed_tags:
      one: "removed(sing) the {tags}"
      two: "removed(dual) the {tags}"
      other: "removed(plur) the {tags}"

In other words, is the number context applied recursively?

EDIT: Come to think of it, the version proposed by @amdad is applying it recursively, so I guess this version should work too!

If it isn't, then what @amdad proposes looks great.

(I'm guessing the first proposal involved abstracting the word "tag" from all the {action} strings?)

@amdad
Copy link
Author

amdad commented Sep 20, 2015

Yes, first proposal was about placing {username} and {tags} in one string.
But this caused problem when it comes to mixed content. When Someone add and remove tags at once. Then I realized separating action strings is much flexible. Much more simple.

Like your example is OK, but in this line is error:

  added_tags: ~~"added the {tags}"~~ // This should be removed
      one: "added(sing) the {tags}"
      two: "added(dual) the {tags}"
      other: "added(plur) the {tags}"

I used, one, two and other because of my localization working on this.

app.translator.plural = function(count) {
  if (count == 1) {
    return 'one';
  }
  else if (count > 1 && count < 5) {
        return 'two';
  }
  else {
    return 'other';
  }
};

And I use this second rule almost everywhere. But rules can be different for each language. Though, I think not many languages have such expanded grammar as mine 😄

@dcsjapan
Copy link
Contributor

Thanks, I thought I had removed that string from the line you pointed out. Fixed! 😄

Which language are you localizing for @amdad ?

@amdad
Copy link
Author

amdad commented Sep 20, 2015

Taking on Chat. Thanks for interest dcsjapan

@dcsjapan
Copy link
Contributor

Glad to help!

It seems there's two issues happening at once here:

  • Number context needs to be applied to added_tags and removed_tags.
  • Also, the object "tags" needs to come before the list of tags.

That was getting me confused. I'm thinking that if @tobscure can solve the first problem, the second will take care of itself, as the translator can handle that on their end.

@dcsjapan
Copy link
Contributor

Update after chatting with @tobscure ...

  • The code needs to to supply separate "count" values for added_tags and removed_tags as well.
  • Use of punctuate() needs to be avoided, since some languages don't use "and" to join clauses.
  • Instead, it would be best to replace discussion_tagged_post with three strings:
    • One for cases where tags are only added.
    • One for cases where tags are only removed.
    • One for cases where tags are both added and removed.
  • The third one would still need to accommodate separate "count" values for the two verbs.

Example ( credit to @tobscure ):

discussion_tagged_post_added: {username} {added}
discussion_tagged_post_removed: {username} {removed}
discussion_tagged_post_added_and_removed:  {username} {added} and {removed}
added_tags: added {tags}
removed_tags: removed {tags}

@amdad
Copy link
Author

amdad commented Sep 21, 2015

Oh, all was mainly in my first proposal, which I removed. Because I worry about:

The third one would still need to accommodate separate "count" values for the two verbs.

But if this will on board it will be all great. Just to be sure, of course, in your arrangement added_tags: and removed_tags: will allow for full pluralization?

added_tags: 
  one: added the {tags} tag 
  two: added the {tags} tags
  other: ...
removed_tags:  
  one: removed the {tags} tag 
  other: ...

@tobyzerner
Copy link
Contributor

Yes :)

@amdad
Copy link
Author

amdad commented Sep 21, 2015

Great Thank You!

@ghost
Copy link

ghost commented Sep 22, 2015

Thanks, it will as well fix the French translation which is affected by that.

@ghost
Copy link

ghost commented Oct 23, 2015

This have been fixed and can be closed now.

@dcsjapan
Copy link
Contributor

Not quite ... the necessary strings are there, but Toby still needs to do a bit of coding to support them. (See the comments in DiscussionTaggedPost.js for details.) It should be very soon, though. 😉

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

4 participants