Programming in a different language like russian, italian, etc [duplicate] - localization

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Coding in Other (Spoken) Languages
When writing code, do people from other parts of the world have to use the English language keywords for code written in things like .NET, PHP, SQL, etc? Someone else actually asked me this and after a few minutes of thought, I was actually stumped. The question was specific to writing SQL but is there a general rule of thumb? If a Russian developer who doesn't speak English wants to write some SQL, do they need to learn the "FROM, ORDERBY" etc in English? Are there parsers or are these languages "locale aware"?

People do not program in English. They program in a programming language.
Many of the popular languages use keywords taken from the English language, but you will see in many non-English countries variable names and comments that are in the native language.
So, someone may have to learn the keywords FROM and ORDER BY and understand their semantic meaning, but still have no idea about them being English (or how to pronounce them).
No modern language is localized in the manner you describe (i.e. parsers), so in effect, yes, they need to be learned in "English".

Related

How do I specify language when storing strings?

I'm currently developing a system that supports several languages. I want to specify these languages as precisely as possible in the database in case of future integrations. (Yes I know it's a bit YAGNI)
I've found several ways to define a language
nb-NO
nb_NO
nb-no
nb_no
nb
These can all mean "Norwegian Bokmål". Which one, if any, is the most correct?
The Locale article on the ArchLinux Wiki specifies a Locale as language[_territory][.codeset][#modifier]. The codeset and modifier I guess are only relevant for input. But language is a minimum and territory may be nice to have should we implement cultural differences regarding currency and decimal points etc.
Am I overthinking it?
Look at BCP 47
https://tools.ietf.org/html/bcp47
In this day and age you would need at to support at least language, script, region (only language being mandatory to be present)
It depends a lot what you use this tags for.
If it is spoken content you might care about dialect (for instance Cantonese vs Mandarin Chinese), but not script. In written form you will care about script (Traditional vs. Simplified Chinese), but not dialect.
It also matters a lot the complete stack you use to process things. You might use minus as separator, use grandfathered ids, or the -u- extension (see bcp,) then discover that you use a programming language that "chokes" on it. Or you use "he" for Hebrew, but your language (cough Java cough) wants the deprecated "iw"
So you might decide to use the same locale id as your tech stack, or have a "conversion layer".
If you want things accessible from several technologies, then conversion layers is your only (reasonable) option.

How to develop a multilingual Wordpress website in English and Arabic? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am going to develop a Wordpress website in English and Arabic, but I don't the know Arabic language. I am comfortable in English only.
Is there a plugin which will convert the whole website into the Arabic language?
Or is there a better approach for this problem? Clients want the website to be in English and Arabic.
Your problem belongs in the field of website internationalization (i18n) and localization (l10n), there are also language specific challenges for Arabic (being a language with right-to-left script), but first things first.
To implement a multilingual website in Wordpress you need to address the subject in two major areas.
Backend
Support for writing and storing posts and pages in various languages;
Multilingual category/tag names;
Possible need for multilingual custom fields.
Frontend
Internationalized theme which is ready to present the content as well as the frontend UI labels (e.g. "Previous Post", "Next Post", "Archives", etc.) in various languages and scripts;
Language negotiation, namely selecting the proper language and keeping it across pages;
Proper handling of locale-sensitive data; e.g. date and time, number formats, sorting, transliteration, currency names and symbols, etc;
i18n for SEO.
The bad news is that Wordpress doesn't support any of these out-of-the-box. The good news is that there are plenty of plugins and knowledge available on this subject hence the popularity of the platform. Picking a language support plugin which suits your current and future needs is very important, because you don't want to localize 50% of your content using one plugin to find out that it doesn't support some essential requirement you recently came upon.
You definitely should consider consulting this very concise document on Wordpress Codex on the subject.
I personally used qTranslate to get multilingual to work on the backend and database and did all the needed development directly in the theme. Back then (3 years ago) this was the best and most scalable option available on WPMU. There might be better choices out there these days. When it comes to handling locale-sensitive data and SEO, you are totally on your own since none of the plugins I know of provides a satisfactory coverage. In case you want to know more about i18n on the web, here is a good starting point.
Regarding supporting Arabic (and generally right-to-left scripts) on the web, mostly it comes down to use of 'dir' attribute and some wrapping for the text. There are these four essential documents by Richard Ishida of W3C which elaborate on this and gives you a very good head-start.
I assume you want an automatic translation since you can't speak/write Arabic yourself? If so, then something like one of these will do the trick:
http://wordpress.org/plugins/google-translator/
http://wordpress.org/plugins/polylang/
Polylang lets you choose between an automatic translation and writing it yourself. There are many language plugins for Wordpress, so pick the one that works best for you.

Would Google Translate do a good job for translating my software?

Just wondering how users translate their software, I've just finished making my software able to use different language but I'm not sure that Google translate is accurate enough.
No; I wouldn't recommend it.
Machine translators will not handle short domain-specific strings very well.
Your UI is likely to have non-standard words or usages that the translator will choke on or mistranslate.
Also, machine translations tend to look very unprofessional.
I don't think Google Translate would be sufficient, I would recommend to get a collaborator that knows your language and the language that you want to translate to.
Google translate might work for lists of words but will make a mess of sentences and make your software look really bad. Better to hire or talk nicely to a native speaker to get your sentences translated.

Resources for translating common programming terms for UI into other languages

I'm not even sure this is entirely programming related...but here goes:
I need to translate some forms into different languages, specifically Spanish and French. Obviously, it would be good if I knew these other languages fluently, but I don't. Besides doing a Google translate, babel fish, etc. are there any resources which can assist in this? Mainly I am trying to find out what the translation of OK and Cancel are.
Moreover, I looked to find some programs which have the UI written in these other languages and all I could find were language learning programs.
How do other programmers handle doing this?
Take a look at the Pootle Terminology project:
http://pootle.locamotion.org/projects/terminology/
and Microsoft's UI translations:
http://www.microsoft.com/Language/en-US/Translations.aspx
Both provide translations for common UI terminology in a range of languages.
If you want to do it right, it seems like you need to hire a person to translate for you. Preferably a native speaker. I'm sure you can find some services through a quick google search.
The best resource for this is probably a translator who speaks the language in question fluently and has experience translating user interfaces.
Here's just one example of a company that provides this service:
http://www.ricintl.com/software-localization-services.htm
For spanish is ok to user: "Ok and "Cancelar"

ActionScript - What Programming Language Category is it? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Is ActionScript a scripting language or is it more an object-oriented programming language like Java? A quick check on Wikipedia lists it among scripting languages...
AS is a variant of ECMAScript. you can say it's a dialect of JavaScript.
as such, it has and has always had, OO qualities. it's not 'more' OO in 3.0 than before, it's just more "java-OO like" than before. because now it includes language support for class-based inheritance.
of course, the usual prototype based inheritance is still there, and it's a superset of class-based style.
and nothing of this makes it any less 'scripting' than before.
Although it is called Action"Script" it is an Object Oriented Language very Java-like. All code gets compiled into a binary swf file.
ActionScript 1 also was OO based on prototypes.
ActionScript 2 adds classes, accessors, etc but this is pretty much syntactic sugar on top of AS1.
ActionScript 3 is completely redesigned and runs in a new virtual machine (AVM2) inside the Flash Player in parallel with the old virtual machine.
It's a variant of EcmaScript, so it's akin to JavaScript.
ActionScript
The two are not mutually exclusive.
The structure of the later AS versions are object-oriented, however it is not compiled into native assembler. It is instead interpreted as byte code.
Who says a scripting language can't be OO? I'd say it's both a scripting language and OO.
I mean, for instance, Python is often called a scripting language, and can be used simply to script existing applications. It's also OO. Both can in fact be merged if the software in question, say, requires you to pass in an object that adheres to a certain interface.
what distinguishes Java from AS3?
Not a lot. Both generate bytecode that gets passed around, then compiled to machine code on the target platform through a JIT.
While AS3 is commonly described as belonging to the EcmaScript family, it has 2 co-existing object models under the hood. One is the traditional prototypical approach, while the other is a much more java-like approach, with packages, classes and interfaces, subclassing, abstract and final methods, etc.
Similarly, AS3 can be used without any explicit typing (just like javascript), or it can be used with strong typing, like Java. Unlike AS2, any type information given is encoded in the compiled bytecodes, and verified at runtime.
Note that the default compiler settings encourage developers to go toward the java-like flavor, but it's nothing that can't be fixed with a few options.
Essentially, ActionScript evolved from a toy language (See Flash 4 and below) to an javascript-like language (Flash 5 and 6), to an ecmascript language pretending to be something else (Flash 7 and 8) to something that has now more in common with Java and C# than with its own older incarnations (Flash 9 and 10)
To go back briefly to the original question, I can think of two language features that almost every scripting language has, that AS3 lacks:
The ability to run a script from source directly. AS3 requires an explicit compilation step.
The ability to evaluate a string at runtime as a code fragment. Don't look for an "eval" statement in AS3, it just doesn't exist.
AS 3.0 can be written as OO. Previous versions are more JavaScript like and procedural.
Someone described ActionScript to me as an event oriented programming language. AS3 is a scripting language with OO features.
Without defining what you mean by scripting language nobody can answer this question.
As Larry Wall puts it so well in Programming is Hard, Let's Go Scripting... :
"I think, to most people, scripting is a lot like obscenity. I can't define it, but I'll know it when I see it."
and
"But basically, scripting is not a technical term. When we call something a scripting language, we're primarily making a linguistic and cultural judgment, not a technical judgment."
I think it might depend on what version you are asking about. I am not an actionscript expert, but it looks like the designers are trying to make it an object oriented language. I think with 3.0 they have effectively made the jump (at least partially) to an object oriented language.
OK Thanks for the input guys, the best answers seem to be AS3 is both an OOP language and a scripting language. I guess this goes back to the definition of a scripting language - are scripting languages compiled? I have been equating AS3 and Java because both are compiled to byte code and run inside a VM, but I never hear java referred to as a scripting language, I guess I am still a bit confused...
I guess my question is now what distinguishes Java from AS3?

Resources