1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Future Fix UI design issue: hardcoded colons can't be localized

Discussion in 'Future-Fix Bug Reports' started by Dominion, May 12, 2011.

  1. Dominion

    Dominion Active Member

    I've started on my Japanese translation, and quickly ran into a bit of difficulty. Have a look at this login dialog (still only partially translated):

    Login_dialog.png

    You may notice that the colon at the end of the "name or address" text looks a bit smaller than the rest of the text. This is because Japanese uses two-byte fixed width fonts and Latin-based languages use single-byte proportional. The hardcoded colon is smaller because it appears in a different font from all the Japanese characters.

    Here's what it should look like, courtesy of my graphics editor:

    Login_fixed.png

    I don't think I got the alignment of the colon quite right (I'm probably not even using the correct font), but it's close enough. See how the characters in the first two lines line up nicely one over the other? The colons need to be rendered in the Japanese font or the results will appear somewhat less than professional to native speakers.

    I hate to make this recommendation, as it's probably going to mean a lot of revising of not only the original English phrases but all localized versions, but the colons (along with any other hardcoded punctuation) really need to be in the phrases.

    In other words, they need to be handled in the same manner as the question marks, which were correctly included in the phrases. I say "correctly" not only because they can be rendered in the correct font, but also because they can be omitted if necessary. For example, the question mark isn't needed after the "forgot your password?" string because that phrase is better translated without the interrogative.

    To be sure, I'd just as soon have the option of removing the trailing colons altogether, as Japanese forms generally (barring rare exceptions) omit them, as in the following random example:

    http://www.rememberthemilk.com/signup/

    I don't know if it's possible or desirable, but you may be able to avoid moving all the colons to the phrases by creating a "colon" phrase and using it to replace all the hardcoded colons. If you go this route, please be sure to allow for the possibility of a null value for that phrase, so colons can be omitted if necessary.

    Thanks for your attention to this matter.
     
    Valhalla, Liam W, tyteen4a03 and 2 others like this.
  2. Mike

    Mike XenForo Developer Staff Member

    We've actually considered that for a while. To my knowledge, this is the first time this issue has been brought up, though I think a similar issue can happen in other languages.

    This is a worthwhile fix, though obviously a big pain. I could see us doing it for 1.1 though, so I'm considering this a "future fix".
     
  3. Dominion

    Dominion Active Member

    Thanks, Mike. Anyone using a two-byte encoding would probably be affected by this issue. I expect the Chinese translations could also benefit from the fix, but I can only speculate as to why those translators didn't bring it up. I've been working as a professional translator for a long time and have a fair bit of experience with software localization (mostly industrial stuff), so perhaps that's made me more sensitive to things like this.

    Generally speaking any text that gets displayed on screen should be included in localizable resources, as you never can be sure where an issue such as this can crop up.

    I'm glad you think it's a worthwhile fix, as I'd really like my own site to look as good as it possibly can, and I've been hoping that my translations would help promote sales of XF in Japan. How far in the future are we talking? I guess I can press ahead with my translations and put up with the unpleasant colons if it won't be too long.
     
    Adam Howard likes this.
  4. Brogan

    Brogan XenForo Moderator Staff Member

  5. Dominion

    Dominion Active Member

    So about a half a year then, give or take. Thanks, Brogan, I can live with that. :)
     
    Adam Howard likes this.
  6. Dominion

    Dominion Active Member

    Mike, do you have an easy way of tracking down the hardcoded colons that need to be changed?

    If not, I may be able to help out. Since I'm just getting started on the translation, I can make a list of all the instances I find as I go along. (In fact, I'm thinking of doing so anyhow as it would allow me to review and adjust my strings once your change is in place.) Would that be of any use to you?

    At the very least, you could use it as a checklist to be sure you don't miss any.
     
    Adam Howard likes this.
  7. Mike

    Mike XenForo Developer Staff Member

    On the whole, "}:" will probably match most of them - but there will be far too many to document. I should be able to track most of them down programmatically anyway, so no need to document them, though thank you for the offer. :)
     
    Adam Howard likes this.
  8. Dominion

    Dominion Active Member

    You're quite welcome. I've started the list anyhow, as I've decided I'll want to review them all in any case (it seems some of my strings may indeed need to be changed after the revision).

    So feel free to let me know if you want my list after all. Heck, I may end up just posting it in the support forums, in case any other translators feel the need to do a similar review.
     
    Adam Howard likes this.
  9. Dominion

    Dominion Active Member

    I've found some additional hardcoded punctuation that's interfering with Japanese localization:

    Ellipses: appear after phrases such as the following (this list may not be complete):
    • "search" in the search box
    • "log_in_or_sign_up_to_post" in forum listings
    The Latin ellipse is smaller and spaced out a bit differently than the Japanese font. A change would allow for a slight cosmetic improvement. (In the case of a drop-down menu it might be better to replace the ellipse with a downward triangle, as the former is generally used indicate a modal dialog rather than a drop-down menu.)

    Parentheses: appear enclosing phrases such as the following (this list may not be complete):
    • "unspecified" in the registration form
    • "log_in_or_sign_up_to_post" in forum listings
    • "log_in_or_sign_up_to_reply" in thread listings
    Japanese parentheses are slightly larger, as they need to be given the greater height of Japanese characters. The Latin style parentheses look particularly out of place. As with the colons, it would be best if we had the option to omit the parentheses altogether.

    Commas: appear between the author and the date/time in all forum and topic listings; also between the date/time and the forum title in watched and recent thread listings.

    Japanese has a much different comma, which looks like this: 、 So this really needs to be changed.

    Would it be possible to move the whole author/date sequence into a single phrase (and the whole author/date/forum sequence into another)? Doing this would not only allow localizers greater control over punctuation and the order of data elements (in case it may be more natural to put the date before the author), it would also allow forum owners to adjust the author/date phrase to their liking (e.g., some forums may benefit from a less terse presentation, such as "Posted by x on y at z" instead of simply "x, y at z").

    There may be more punctuation marks that I haven't encountered yet. I'll update this thread if I find any.
     
    Adam Howard likes this.
  10. Dominion

    Dominion Active Member

    Yet another type of hardcoded punctuation for the list:

    Semicolons:

    Following the description of the embedded media BBcode tag one sees the "approved_sites" phrase followed by a hardcoded colon. Then there's a generated list of approved sites, separated by semicolons (which are practically never used in Japanese). I need to be able to change those to Japanese commas.
     
    Adam Howard likes this.
  11. Dominion

    Dominion Active Member

    I've just noticed an issue that could complicate the resolution of this hardcoded punctuation problem a bit.

    Many of the punctuation marks I've mentioned so far have appeared in places where they probably aren't followed by a hardcoded space. (This is true when the phrase is a label for a field in a form, or when it appears in a field or as the name of a button, etc.) Those can be worked around by specifying replacements as language options.

    But there are also many cases where hardcoded punctuation marks are used to separate variables presented in a single sequence. The colon and semicolons I mentioned in the preceding post are one example. Here's another from a list of threads in a forum:

    screenshot1.jpg

    And another, from a page of search results (listing results as threads):

    screenshot2.jpg

    As you can see, colons and commas are frequently used in this manner. Each of these is doubtless followed by a hardcoded space, which will complicate the replacement solution. Allow me to explain.

    The Japanese comma is only about half as wide as a full-width character, but since Japanese fonts are fixed-width, the comma character includes a generous amount of white space, as you can see below:

    世界よ、こんにちは!​

    In this example (which means "Hello, world!" ;)) there's no space after the comma. The gap is part of the character. Now let's assume this is actually two phrases, separated by a hardcoded comma-and-space. If we simply replace the English comma with the Japanese comma, it comes out like this:

    世界よ、 こんにちは!​

    The space is marginally wider, resulting in a less-than-professional look. So it would be especially wise to avoid this approach to comma replacement when two phrases must be combined to form a sentence. (I'm hoping that there aren't many examples of that sort of thing in XF; I haven't found any yet, at least.) In a sequence of variables with only loose grammatical links, such as are shown in the screenshots above, this may be less of an issue.

    The presence of the loose grammatical links, however, does make me wish that these bits of info were combined in a single phrase that I could arrange as needed. For example, the data for the last thread in the second screenshot currently look something like this:

    トピック開始者: Dominion, 2011-5-13, 返答数 4, フォーラム: XenForo Bug Reports

    This could be translated as follows:

    Topic starter: Dominion, 2011-5-13, 4 responses, Forum: XenForo Bug Reports

    We can live with that, but it would look much better like this:

    トピックは Dominion により 2011-5-13 に開始、返答数 4、フォーラムは『XenForo Bug Reports』

    which translates as something like:

    Topic started by Dominion on 2011-5-13, 4 responses, in forum XenForo Bug Reports

    Here I've made the Japanese easier to read by adding text (the bits in red) in two places: (a) between the author's name and the date, and (b) between the date and the responses. (This works because the author and date are both related to the starting of the thread, and the verb in Japanese should come at the end.) But there's no way to accomplish this unless the whole thing is a single phrase. But this would be the ideal arrangement. (When I asked my wife about the current arrangement, she says it seems gikushaku, which I suppose is the Japanese for "clunky." But like I said, we can probably live it.)

    The colons in the example may pose a slightly more serious issue. As I've mentioned previously, I'd like the option to just get rid of them (for example, at the end of phrases that label input fields in forms). But if we use a language option to get rid of all colons everywhere, then we have to decide what to do in cases like the above.

    I could probably add a は (or even a Japanese colon) to the "thread_by" phrase, to replace the hardcoded colon that will be removed using the language option setting. But I cannot do these things to the "forum" string, as that is being reused in other places where neither addition would be appropriate.

    I don't have any suggested solutions at this point, as I'm still gathering data. I suppose the path of least resistance would be to (1) provide the language option settings as a workaround for the hardcoded punctuation, (2) check and see how that affects the display of data such as the above, and (3) propose new (split) phrases to solve any issues that have cropped up.

    Second thoughts, a few days later:

    On the other hand, combining lists of information like the ones I discuss above into a single phrase each would certainly reduce the amount of hardcoded punctuation that needs to be handled by the punctuation localization settings in the language options; it could potentially simplify the problem of creating those settings.

    So it actually might be best to consolidate such lists into phrases first, then worry about what to do with any hardcoded punctuation that remains once that is done. ;)
     
    Adam Howard likes this.
  12. Panupat

    Panupat Well-Known Member

    Want to say that the log in screen looks absolute fantastic in Japanese. Reminds me of the time I was inputting fake address in POL to play FFXI >.>

    IPB has quite a smart approach to this. Each phrases you translate, you can use board's variable. Kinda like this

    Topics was started by <username> at <datetime>

    We can construct the sentence however we like, just have to add the <username> bits at the right place.
     
    Adam Howard and Luke F like this.
  13. Dominion

    Dominion Active Member

    Thank you! :) You were playing FFXI on a Japanese server?

    XenForo also does this with many phrases, as well. Unfortunately (at least for some localizers like myself) there are a few places like this, where a different approach was adopted. I hope Kier and Mike will take note of your comment and consider making the single-phrase approach universal.
     
  14. Panupat

    Panupat Well-Known Member

    Yes I imported Japanese FFXI as soon as the PC version came out. To this day, it is still my best online gaming experience no other game can ever compare.
     
    Adam Howard likes this.
  15. Dominion

    Dominion Active Member

    I don't mean to cut you off, Panupat, but I need to get back to the subject of hardcoded punctuation.

    I just noticed another small issue involving different applications of hardcoded punctuation after the same types of phrase. On the Current Visitors page, the variable for the visitor's most recent activity is followed by a space:

    screenshot1.jpg

    In the user profile popup, it's followed by a comma-space:

    screenshot2.jpg

    I had been thinking I could add a Japanese colon to the end of each such phrase; that would look good on the Current Visitors page. Then I realized I was getting a Japanese colon followed by an English comma on the popup, which doesn't look good at all.

    If we're going to have hardcoded punctuation after phrases, then it should be the same punctuation in every instance where the phrase is used. That would make it easier for localizers to work around the hardcoding.

    But it would still be best if each of the above instances could be worked into phrases, since in Japanese the "when" part usually comes at the beginning of the sentence. For example, if the two phrases displayed in each of these two locations could be abstracted as variables named "latest_activity" and "latest_activity_time", then I could do something like this for the Current Visitors page:

    {lastest_activity_time}に{latest_activity}でした。​

    and something like this for the popup:

    {name}は、{lastest_activity_time}に{latest_activity}に目撃されました。​

    This is a slightly advanced version of the suggestion I made in my previous post regarding the information listed under the titles of topics in the Search Results page. I don't know how practical it is, though. Is it even possible to include a phrase name variable as part of another phrase? :confused: If it can be done, it would certainly be my preferred solution.
     
    Adam Howard likes this.
  16. tyteen4a03

    tyteen4a03 Well-Known Member

    I am doing a Chinese translation and have run into the same issues as Dominion's. I prefer the phrase-in-phrase solution too as the translations would make more sense (e.g it's really hard to translate "by" to Chinese directly so a lot of times we are forced to change forms; e.g "Post By" is translated into something as "Poster".)
     
    Valhalla and Liam W like this.
  17. Ahmed

    Ahmed Well-Known Member

    I hope this will get fixed soon.
     

Share This Page