Locale name explanation - internationalization

ALL,
I am a complete idiot when it comes to locale and i18n programming.
What I do know is that the locale name contains 5 symbols (as an example en-US).
I presume that the first 2 characters there are to identify the language on which OS and application will communicate the UI to the user. And the last 2 symbols are for date/time/currency/etc formatting purposes.
Is this true? Is there some additional meaning to that?
Or I am completely off and the first point is for the whole locale itself?
Could someone please enlighten me.
TIA!!

Please see RFC 4646 for a detailed explanation of what the codes mean.

Related

How can I change this symbol? Magento

I have this page:
http://www.moment-of-style.com/onlajn-magazin/pal-to-pidzhaki/denim-bomber-148.html
I simply replace this with something and can not find where to do this modification.
I put an image to better understand what they want
I tried to follow this tutorial but I could not.
http://magentocoders.blogspot.in/2011/10/insert-rupee-symbol-instead-of-rs-in.html
Can anyone help me to solve this problem?
I think the shown currency is Russian Ruble. The currency code for Rubles is RUB, and the currency symbol is руб. The question isn't clear. So i will give you suggestions as i understood your question.
First of all, if you want to use Russian Ruble as your currency then the symbol 'руб' is perfect. Although no symbol exists officially, руб (three Cyrillic characters which are the equivalent of RUB in Russian) is currently used.
Second, if you want to use RUB instead of руб then follow the below steps. It works perfect for me.
Goto->AdminPanel->Configuration->Currency Setup->Base Currency(Set Russian Rubel). Do the same for Default Display Currency and allowed currency.
Now Go to->Adminpanel->System->Manage Currency->Symbols-> Change your symbol here(You can see руб here, change it).
Third and the last, characters of your site suggest the Serbian language(as per Google translate). You can do same as step 2 for the Serbian currency.
Let me know, if you need any help.

Changing CodeIgniter url_title from Czech characters to standard English characters

What's the best way to save CodeIgniter url_title's originally written using Czech characters as standard English characters? For example:
Currently this:
/projects/Hledám-sponzora-na-nákup-příslušenství-k-invalidní1/123
I'd prefer this:
/projects/hledam-sponzora-na-nakup-prislusenstvi-k-invalidni1/123
I tried changing just the url_title table collation to non-Czech, but it caused an error when submitting the form. Any ideas?
Just in case anybody needs it (a year later), try with convert_accented_characters() of the Text Helper. This is how I do it:
url_title(convert_accented_characters($title_with_accents), 'dash', TRUE)
Works quite well :)
You can also check the file application/config/foreign_chars.php and edit it if it's needed.
I don't understand what you are trying to do... Are these urls? If so, I'd choose numbers that associate to the titles you want to use.
Could you show the markup of the form? Also the controller function that handles the submission could be major help... Help us help you!

What does the sharp and exclamation mark (#!) stand for in a url? Don't even know how to look for an answer

I have seen these "domain.com/#!/" formated urls, and driven merely by curiosity I chose to ask you people... what is that used for? A kinda "exclamated-hashtag" if you know what I mean.
I see it on sites such as "hypem.com" or "buzzchips.com", both of them delivering asynchronous dynamic content in a similar way.
I uploaded a tiny shot just so you actually see what I see, here and there.
It appears to be a standard for allowing dynamically created content to be crawled.
You can see a good explanation of this under the SEO heading for the following answer:
https://softwareengineering.stackexchange.com/questions/46716/what-should-a-developer-know-before-building-a-public-web-site/46760#46760

Captcha for Japanese and Chinese?

Normally I use Recaptcha for all captcha purposes, but now I'm building a website that is translated into Chinese and Japanese, among other languages. I'd like to make the captcha as accessible to those users as possible. Even if they can read and type English characters (which is not necessarily the case), often times even I as an English-speaker have had trouble figuring out what the word in Recaptcha has to be.
One good solution I've seen (from Google) is to use numbers instead of text. Are there other good solutions? Is there a reliable free captcha service out there such as Recaptcha that offers this option?
The Chinese and Japanese both use a keyboard with Latin characters on. The Chinese input their 1000s of characters via Pinyin (Romanized Chinese) and so they are very familiar with all the same letters that you and I are. Therefore, whatever you are using for English speaking people can also be used for them.
PS - I know this is an answer to an old post, but I'm hoping this answer will help anyone who comes here with the same question.
I have encountered the same problem in the past, I resolved the issue by using the following CAPTCHA which uses a numerical validation:
http://www.tipstricks.org/
However, this may not be the best solution for you, so here is an extensive list of different CAPTCHAs you might want to consider (most of them are text based, but some use alternative methods such as numerical expressions):
http://captcha.org/
Hope this helps

Why do people use plain english as translation placeholders?

This may be a stupid question, but here goes.
I've seen several projects using some translation library (e.g. gettext) working with plain english placeholders. So for example:
_("Please enter your name");
instead of abstract placeholders (which has always been my instinctive preference)
_("error_please_enter_name");
I have seen various recommendations on SO to work with the former method, but I don't understand why. What I don't get is what do you do if you need to change the english wording? Because if the actual text is used as the key for all existing translations, you would have to edit all the translations, too, and change each key. Or don't you?
Isn't that awfully cumbersome? Why is this the industry standard?
It's definitely not proper normalization to do it this way. Are there massive advantages to this method that I'm not seeing?
Yes, you have to alter the existing translation files, and that is a good thing.
If you change the English wording, the translations probably need to change, too. Even if they don't, you need someone who speaks the other language to check.
You prep a new version, and part of the QA process is checking the translations. If the English wording changed and nobody checked the translation, it'll stick out like a sore thumb and it'll get fixed.
The main language is already existent: you don't need to translate it.
Translators have better context with a real sentence than vague placeholders.
The placeholders are just the keys, it's still possible to change the original language by creating a translation for it. Because when the translation doesn't exists, it uses the placeholder as the translated text.
We've been using abstract placeholders for a while and it was pretty annoying having to write everything twice when creating a new function. When English is the placeholder, you just write the code in English, you have meaningful output from the start and don't have to think about naming placeholders.
So my reason would be less work for the developers.
I like your second approach. When translating texts you always have the problem of homonyms. Like 'open' can mean a state of a window but also the verb to perform the action. In other languages these homonyms may not exist. That's why you should be able to add meaning to your placeholders. Best approach is to put this meaning in your text library. If this is not possible on the platform the framework you use, it might be a good idea to define a 'development language'. This language will add meaning to the text entries like: 'action_open' and 'state_open'. you will off course have to put extra effort i translating this language to plain english (or the language you develop for). I have put this philosophy in some large projects and in the long run this saves some time (and headaches).
The best way in my opinion is keeping meaning separate so if you develop your own translation library or the one you use supports it you can do something like this:
_(i18n("Please enter your name", "error_please_enter_name"));
Where:
i18n(text, meaning)
Interesting question. I assume the main reason is that you don't have to care about translation or localization files during development as the main language is in the code itself.
Well it probably is just that it's easier to read, and so easier to translate. I'm of the opinion that your way is best for scalability, but it does just require that extra bit of effort, which some developers might not consider worth it... and for some projects, it probably isn't.
There's a fallback hierarchy, from most specific locale to the unlocalised version in the source code.
So French in France might have the following fallback route:
fr_FR
fr
Unlocalised. Source code.
As a result, having proper English sentences in the source code ensures that if a particular translation is not provided for in step (1) or (2), you will at least get a proper understandable sentence than random programmer garbage like “error_file_not_found”.
Plus, what do you do if it is a format string: “Sorry but the %s does not exist” ? Worse still: “Written %s entries to %s, total size: %d” ?
Quite old question but one additional reason I haven't seen in the answers yet:
You could end up with more placeholders than necessary, thus more work for translators and possible inconsistent translations. However, good editors like Poedit or Gtranslator can probably help with that.
To stick with your example:
The text "Please enter your name" could appear in a different context in a different template (that the developer is most likely not aware of and shouldn't need to be). E.g. it could be used not as an error but as a prompt like a placeholder of an input field.
If you use
_("Please enter your name");
it would be reusable, the developer can be unaware of the already existing key for an error message and would just use the same text intuitively.
However, if you used
_("error_please_enter_name");
in a previous template, developers wouldn't necessarily be aware of it and would make up a second key (most likely according to a predefined wording scheme to not end up in complete chaos), e.g.
_("prompt_please_enter_name");
which then has to be translated again.
So I think that doesn't scale very well. A pre-agreed wording scheme of suffixes/prefixes e.g. for contexts can never be as precise as the text itself I think (either too verbose or too general, beforehand you don't know and afterwards it's difficult to change) and is more work for the developer that's not worth it IMHO.
Does anybody agree/disagree?

Resources