HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Help Make Activities and Notifications more Localizable

ToddTodd Chief Product Officer Vanilla Staff
edited July 2012 in Localization

I'd like to get a dialog started with the localization community here so that I can make sure our activities and notifications are localizable into all languages. Currently, some of the different grammars of the world are not supported and I'd like that to change for Vanilla 2.1.

The goals of this exercise are the following:

  1. Get you localizers familiar with the way Vanilla translates activity strings. If you aren't grasping the system then let's work through it here.

  2. Get your feedback with examples on some of the strings we want to support. I want to be able to support all languages in a reasonable way. This will involve some tradeoffs between being able to express a perfect translation and simplicity of implementation.

What are Actvities and Notifications?

  • Activities are the items in the activity feed. You can see each one has a bolded headline and an optional body. The headline is what we're concerned about.

  • Notifications are like activities, but they are addressed just to you. They also contain a headline and an optional body.

  • The headlines aren't just static text. They can contain references to data in the string such as the user that performed the activity. This is what makes the activities great, but also complicates translation. Translating the headline is what we are primarily concerned with here.

Example

Let's go through an example. When a user comments on a discussion it can trigger an activity and/or a notification. Here is what it might look like:

This could also have a few different forms depending on who is viewing it or whether or not other people have jumped in and commented:

Now, let's look at the string that you'd have to translate to generate all of these messages:

{ActivityUserID,You} commented on <a href="{Url,html}">{Data.Name,text}</a>

So one string is used for all of these messages. This makes use of the FormatString() function to replace the stuff between the curly braces with data from the activity.

Using {curly brace} Strings.

The most common curly brace strings you are going to use is {ActivityUserID,...} and {RegardingUserID,...}. The ActivityUserID is usually the user or users that performed the activity. RegardingUserID is usually the user or users that the activity was performed on. You can see that there is also a comma and the word You. This is the format to use and there are a bunch, but here are a few:

User/user

Show the user's name. You can capitalize the word user and it will do the same to the username.

You/you

Show the user's name, but if you are the user viewing the activity then it will show the word you.

his/her/your

Shows the words his or her depending on the user's gender. If you are the user viewing the activity then it will show the word you.

html

Formats the string so that special html characters don't screw things up.

text

Strips html out of the string and formats it as text.

Here are a couple of formats that I think will be useful for translators.

plural

You can format numbers using plural, but you can also do this with users too. So if one user performed the activity it will display one word, but if multiple users performed an activity it will display another word.

'{ActivityUserID,User} {ActivityUserID,plural,was,were} promoted to {Data.Name,plaintext}.'

>

produces the following strings:

'Todd was promoted to Level 2.'
'Todd and Tim were promoted to Level 2.'

gender
You can return a different word depending on the gender of a user. This should be useful for different verbs, pronouns we don't cover, gender suffixes, etc.

'{ActivityUserID,User} stubbed {ActivityUserID,gender,his,her,their} {ActivityUserID,plural,toe,toes}.

Again, there are a lot of options for FormatString(), but I don't want to get carried away in this post. What I want to hear from people that want to help with translation is whether or not they think this can work. I think it might be a good idea if you translate the strings in my example above in this thread using different combinations of users. Don't worry about putting the links in them as I have, just translate the final text for:

  1. You commented on Help Make Activities and Notifications more Localizable.
  2. Todd commented on Help Make Activities and Notifications more Localizable.
  3. Sheila commented on Help Make Activities and Notifications more Localizable.
  4. Todd, Tim and Sheila commented on Help Make Activities and Notifications more Localizable.
«1

Comments

  • Thanks for your post. Glad you have something in the pipeline for this.

    In German this would look like this:

    1. Du hast Help Make Activities and Notifications more Localizable kommentiert.
    2. Todd hat Help Make Activities and Notifications more Localizable kommentiert.
    3. Sheila hat Help Make Activities and Notifications more Localizable kommentiert.
    4. Todd, Tim and Sheila haben Help Make Activities and Notifications more Localizable kommentiert.

    In other words, your suggestion would work for the German localization.

  • ArachnosArachnos La Garenne Colombes
    edited July 2012

    Nice to see that a lot of things happen ;-)

    In French, this will done :

    1. Vous avez commenté Help Make Activities and Notifications more Localizable.
    2. Todd a commenté Help Make Activities and Notifications more Localizable.
    3. Sheila a commenté Help Make Activities and Notifications more Localizable.
    4. Todd, Tim et Sheila ont commenté Help Make Activities and Notifications more Localizable.

    You're going the right way with this adaptation of the Activities and Notifications, because the most sensitive point for the French translation for the structures of verbs, which are different from English.
    This is the same form in English, but not in French (and, I think, some other languages).

    For example (English -> French) :

    1. Todd commented… -> Todd a commenté
    2. You commented… -> Vous avez commenté
  • ToddTodd Chief Product Officer Vanilla Staff

    So from these two responses I think I need to make one change so far and that is to offer a different translation string for notifications and activities. This is one change I was 99% sure I would have to make. This way we could have the following translations strings:

    German

    Du has <a href="{Url,html}">{Data.Name,text}</a> kommentiert. 
    {ActivityUserID,User} {ActivityUserID,plural,hat,haben} <a href="{Url,html}">{Data.Name,text}</a> kommentiert.
    

    French

    Vous avez commenté <a href="{Url,html}">{Data.Name,text}</a>.
    {ActivityUserID,User} {ActivityUserID,plural,a commenté,ont commenté} <a href="{Url,html}">{Data.Name,text}</a>.
    
  • ToddTodd Chief Product Officer Vanilla Staff

    Just want to shout out to @Sheila, @Olivaw, @Torbjorn, @gass3n, @raphaa00, @csakip, @Clough, @JoshuaXD, @Osa in case you want to help out.

  • raphaa00raphaa00 New
    edited July 2012

    In brazilian portuguese (and I think in portuguese portuguese too) the structure of these sentences would look exactly like in english:

    1) Você comentou em Help Make Activities and Notifications more Localizable.

    2) Todd comentou em Help Make Activities and Notifications more Localizable.

    3) Sheila comentou em Help Make Activities and Notifications more Localizable.

    4) Todd, Tim e Sheila comentaram em Help Make Activities and Notifications more Localizable.

    Singular for commented: comentou;

    Plural for commented: comentaram;

    You: você;

    on: em;

    and: e.

  • CloughClough
    edited July 2012

    Turkish is more spesific language. Sometimes one word can not enough.

    For Turkish

    1. Help Make Activities and Notifications more Localizable konusuna yorum yaptınız.

    2. Todd, Help Make Activities and Notifications more Localizable konusuna yorum yaptı. OR Help Make Activities and Notifications more Localizable konusuna Todd yorum yaptı.

    3. Sheila, Help Make Activities and Notifications more Localizable konusuna yorum yaptı. OR Help Make Activities and Notifications more Localizable konusuna Sheila yorum yaptı.

    4. Help Make Activities and Notifications more Localizable konusuna Todd, Tim ve Sheila yorum yaptı . OR Todd, Tim ve Sheila konusuna yorum yaptı.

    But if you want to use correct Turkish grammer conditions, these sentences are the best possible way..

    Help Make Activities and Notifications more Localizable başlıklı konuya yorum yaptınız. (i think the best one)

    OR

    Todd, Help Make Activities and Notifications more Localizable başlıklı konuya yorum yaptı.

    OR

    Todd, Help Make Activities and Notifications more Localizable başlıklı konuyu yorumladınız.

    başlık=title
    konu= subject
    yorum= comment
    yapmak= do

  • ToddTodd Chief Product Officer Vanilla Staff

    Portuguese (Brazil)

    Você comentou em <a href="{Url,html}">{Data.Name,text}</a>. 
    {ActivityUserID,User} {ActivityUserID,plural,comentou,comentaram} em <a href="{Url,html}">{Data.Name,text}</a> kommentiert.
    
  • ToddTodd Chief Product Officer Vanilla Staff
    edited July 2012

    @Clough, I'm trying to follow your post, but I'm not 100% sure. What I gather is that the usernames go before the title if there is one user, but after. I'll need to program some extra functionality to formatting plurals. Let me propose the following:

    Turkish

    <a href="{Url,html}">{Data.Name,text}</a> konusuna yorum yaptınız.
    {ActivityUserID,User,singlular,%%\,} <a href="{Url,html}">{Data.Name,text}</a> {ActivityUserID,User,plural,konsuna %% }{ActivityUserID,plural,başlıklı konuya yorum yaptı,yorum yaptı}.
    

    This will produce the following strings:

    1. Help Make Activities and Notifications more Localizable konusuna yorum yaptınız.

    2. Todd, Help Make Activities and Notifications more Localizable başlıklı konuya yorum yaptınız.

    3. Sheila, Help Make Activities and Notifications more Localizable başlıklı konuya yorum yaptınız.

    4. Help Make Activities and Notifications more Localizable konusuna Todd, Tim ve Sheila yorum yaptı.

    This sytax is quite difficult for Turkish, but once the translation is done it's done and I can help if given examples.

  • SS ✭✭
    edited July 2012

    @Todd
    Check this comment (2011-07-14, a year ago).

    I think you can not satisfy all locales and languages anyway, therefore principal thing what you should to do is to make overridable FormatActivityHeadline(), FormatActivityNotification, etc. functions.

  • SheilaSheila ✭✭

    Hi! Here's how it would translate in Finnish. The basic form for discussion is 'keskustelu', 'keskustelua' is the genitive.

    1. You commented on Help Make Activities and Notifications more Localizable.
    2. Todd commented on Help Make Activities and Notifications more Localizable.
    3. Sheila commented on Help Make Activities and Notifications more Localizable.
    4. Todd, Tim and Sheila commented on Help Make Activities and Notifications more Localizable.
    1. Sinä kommentoit keskustelua Help Make Activities and Notifications more Localizable.
    2. Todd kommentoi keskustelua Help Make Activities and Notifications more Localizable.
    3. Sheila kommentoi keskustelua Help Make Activities and Notifications more Localizable.
    4. Todd, Tim ja Sheila kommentoivat keskustelua Help Make Activities and Notifications more Localizable.
  • ToddTodd Chief Product Officer Vanilla Staff

    Finnish

    Sinä kommentoit keskustelua <a href="{Url,html}">{Data.Name,text}</a>. 
    {ActivityUserID,User} {ActivityUserID,plural,kommentoi,kommentoivat} keskustelua <a href="{Url,html}">{Data.Name,text}</a>.
    
  • CloughClough
    edited July 2012

    @Todd

    1 and 4 are true.

    2 and 3 must be;

    2 -Todd, Help Make Activities and Notifications more Localizable başlıklı konuya yorum yaptınız.

    3 - Sheila, Help Make Activities and Notifications more Localizable başlıklı konuya yorum yaptınız.

    Not important gender.

  • emziemzi
    edited August 2012

    Todd said:
    ... just translate the final text for:

    1. You commented on Help Make Activities and Notifications more Localizable.

    2. Todd commented on Help Make Activities and Notifications more Localizable.

    3. Sheila commented on Help Make Activities and Notifications more Localizable.

    4. Todd, Tim and Sheila commented on Help Make Activities and Notifications more Localizable.


    ۱. شما روی Help Make Activities and Notifications more Localizable دیدگاه نوشتید.

    2. Todd روی Help Make Activities and Notifications more Localizable دیدگاه نوشت.

    3. Sheila روی Help Make Activities and Notifications more Localizable دیدگاه نوشت.

    4. Todd ،Tim و Sheila روی Help Make Activities and Notifications more Localizable دیدگاه نوشتند.







    "You", "He" and "They" need the same verb for the simple past tense in English (except auxiliary verbs as in was/were), but in Persian, for instance "commented" in above strings, is translated in 3 different forms:
    comment = دیدگاه نوشتن

    • You commented = شما دیدگاه نوشتید

    • He commented = او دیدگاه نوشت

    • They commented = ایشان دیدگاه نوشتند

    According to the @HalfCat's translation on the 1st comment, It seems Persian works like German :)

    Note> Comma in Persian is vice versa:
    Todd, Tim and Sheila <=> تاد، تیم و شیلا




    A brief part of Persian grammar:

    I = من /mæn/
    Ex: I went = من رفتم

    We = ما /mɒ/
    Ex: We went = ما رفتیم

    You (person) = تو /tɔː/ OR شما
    Ex: You went = تو رفتی OR شما رفتید

    You (people) = شما /ʃɔːmɒ/
    Ex: You went = شما رفتید

    He/She = او /uː/
    Ex: He/She went = او رفت
    Ex: Sheila went = رفت Sheila

    They = ایشان /iːʃɒn/
    Ex: They went = ایشان رفتند
    Ex: Todd, Tim and Sheila went = رفتند Sheila و Tim ،Todd

    As you see, it's need to use different forms of the verb for different subject pronouns in Persian.

  • ToddTodd Chief Product Officer Vanilla Staff

    So it looks possible in persian using the plural formatter for they. How many languages do you know @Zoie?

  • AnonymooseAnonymoose ✭✭
    edited August 2012

    Would this make it possible to change the ending of the Username, depending on the existing ending (or lack of) of the plain (dictionary) form of the User's name, which is stored by default?

    User 1: Катя
    User 2: Иван

    RU: Катя написала на стене Ивана.
    EN: Katya wrote on Ivan's wall.

    RU: Иван написала на стене Кати.
    EN: Ivan wrote on Katya's wall.

    RU: Катя познакомилась с Иваном.
    EN: Katya is now friends with Ivan.

  • emziemzi
    edited August 2012

    @Todd said:
    So it looks possible in persian using the plural formatter for they.

    شما روی <a href="{Url,html}">{Data.Name,text}</a> دیدگاه نوشتید.
    {ActivityUserID,User} روی <a href="{Url,html}">{Data.Name,text}</a> دیدگاه {ActivityUserID,plural,نوشت,نوشتند}.
    



    You commented on Help Make Activities and Notifications more Localizable.
    You, Tim and Sheila commented on Help Make Activities and Notifications more Localizable.

    what about "You, Tim and Sheila"? what's the {curly brace} String for this format?

  • SS ✭✭
    edited August 2012

    You commented on Help Make Activities and Notifications more Localizable.
    Todd commented on Help Make Activities and Notifications more Localizable.
    Sheila commented on Help Make Activities and Notifications more Localizable.
    Todd, Tim and Sheila commented on Help Make Activities and Notifications more Localizable.

    In Russian, for example.
    1a) Ты (you) оставил (commented) сообщение в теме Help Make Activities and Notifications more (if "You" is reference to male gender and "You" translated as second person and singlar number).
    1b) Ты (you) оставила (commented) сообщение в теме Help Make Activities and Notifications more (if "You" is reference to female gender and "You" translated as second person and singlar number)
    1c) Ты (you) оставило (commented) сообщение в теме Help Make Activities and Notifications more (if "You" is reference to unspecified gender and "You" translated as second person and singlar number)
    1d) Вы (you) оставили сообщение в теме Help Make Activities and Notifications more ("You" can reference to any gender, but "You" translated as second person and plural number)

    2) Todd оставил сообщение в теме Help Make Activities and Notifications more. (as in case 1a)

    3) Sheila оставила сообщение в теме Help Make Activities and Notifications more. (as in case 2b)

    4) Todd, Tim and Sheila оставили сообщение в теме Help Make Activities and Notifications more Localizable.
    commented = "оставили", not as in cases 1a - 1d, because it is verb for plural number.

  • AnonymooseAnonymoose ✭✭
    edited August 2012

    RU: Иван написала на стене Кати.
    EN: Ivan wrote on Katya's wall.

    Correction: Иван написал на стене Кати.

    Here is the same in transliteration:

    RU: Katya napisala na stene Ivana. EN: Katya wrote on Ivan's wall.

    RU: Ivan napisala na stene Kati. EN: Ivan wrote on Katya's wall.

    RU: Katya poznakomilas’ s Ivanom. EN: Katya is now friends with Ivan.

    As can be seen above, when used as an object, a person's name changes ending, depending on the gender. Possessive also is not simply a matter of ending apostrophy s as in English, but depends on the gender of the name.

    All this can be determined programatically based on the ending of the username.

  • ToddTodd Chief Product Officer Vanilla Staff
    edited September 2012

    If you want to format stuff differently depending on gender then you can use the gender format. I added a plural argument so you can pass in word forms for male, female, unknown, plural.

    {ActivityUserID,User}  {ActivityUserID,gender,оставил,оставила,оставил,оставили} в теме <a href="{Url,html}">{Data.Name,text}</a>.
    
  • AnonymooseAnonymoose ✭✭
    edited September 2012

    Thanks Todd.

Sign In or Register to comment.