What is the difference between 'de' and 'de-DE' language codes? - browser

I notice that i can choose in some places* between those languages:
de - German - Deutsch
de-DE - Deutsch(Deutschland) - German(Germany)
*Android initial device setup, chromium browser in language settings. if one selects de-DE in chromium, it automatically adds de too.
i know that de-DE means 'German as spoken in Germany'.
but i dont know a other country where german is spoken that does not have its own language variant (like de-CH for switzerland or de-AT for austria).
so what is the reason for having both variants to chose from? do they have any actual difference? i could imagine that people from switzerland use de-CH as primary language and de as fallback, but they could also use de-DE for that purpose, right?
i know that there is es-ES for spain and 'es' for other countries where espanol is spoken, but that do not have their own variant code.
Background: i want to track how many users use which primary language (browser header) and im not sure if de and de-de should be counted together or seperate, and whats the differences is.
i use the language database from http://peric.github.io/GetCountries/ which has 'de' but no 'de-DE' language. is the database correct with having only 'de'?

A lot of environments (browsers, Android) use one single locale setting both for selecting the language of the UI, and to format numbers, dates, times, etc.
If you select de-CH (for instance in Android N) you will get "German" strings (the Android translation is "generic German"), but Swiss dates / times / etc.
For instance the numbers use apostrophe as thousand separator (like 1'234'567,89), the currency formatter will use CHF, and so on.
On Android before N you selected "German" from the language list, but the default locale set was de-DE ("German" without region was just a UI thing)
To track user settings: unfortunately, just "de" or "de-DE" is not a reliable signal, as not all systems allow for a region selection.
But if you see something else (for instance en-CH), then it is more reliable.
You can also try to correlate with info from the IP address. If my setting says "de" and my IP address is in Austria, you might infer that in fact I prefer de-AT (not 100% reliable, but better than "de").

It depends what you want to count. I'm from Switzerland my browser code is de-CH and de as a fallback.
So, if you just want to count all German speaking countries, using de should be enough. Just make sure you also add all de-CH entries to de. Not everybody will have the fallback in their browsers.

Related

Are SharePoint Column / Field variations gone in SPO?

For years I created columns in SP in the following way:
Fix browser accept-language header to default language of site
(e.g. en-US)
Create column with an internal name
Rename column to default language name
Fix browser accept-language header to next language (e.g. de-DE)
Rename column to next language name
This worked and the translated names are still shown.
I now tried the same steps on 2 new sites on different tenants and it seems variants are not longer created: always all languages are changed.
resx files created by Site settings > Export Translations does not contain newly created fields / columns.
Was this feature removed?
If yes: what is the current way to create multilingual data-lists (one list filled by many users in different countries/languages)?
If no: has the way to translate fields / columns changed? Or is this a (temporal) bug in current SPO?
The multilingual user interface (MUI) works exactly the same way in SharePoint Online as on premise. However your browser's Accept-language is not the only thing that governs the current UI language, your profile language is another factor, and you have to wait for it to take effect.
When you change your language in order to enter the column names in a different language, check that at least some of the built-in UI, menus, edit link, etc, is in the new language. Bits of it are cached and will take a long time to be in the right language, but as soon as some of it changes, you are good to edit those column names and any untranslated navigation while you are at it.

How to add a new language to SAP Hybris e- Commerce Storefront(Electronics UK Website)

My requirement: I want to add one more language say Spanish in footer section of language drop down list on Electronic UK storefront. Once we select the Spanish language our website content should change to Spanish Language.
I have read the hybris wiki related to Internationalization and Localization but I could not find any optimal solution.
Please help me in this to achieve the above functionality.
Open hmc or backoffice. Open your current base store, navigate to languages and add spanish to the list.
Notice, that there will be no data for the language, so your homepage might look very empty.
If you want to add localizations for the cms and product content, you have to add the language to all your catalog versions. Otherwise, your language wont show up in the cmscockpit/productcockpit.
Everything that appears on your homepage as words separated by dots (e.g. "search.placeholder") is not saved in the database. Those are spring messages. They are maintained in a file in your storefront. Find them in
/mystorefront/web/webroot/WEB-INF/messages/
by the names
base_XX.properties
theme-my-theme_XX.properties
site-my-site_XX.properties
where XX is the isocode of your language (in your case es). If the file does not exist, create it. You can use the english file (e.g. base_en.properties) as a template and change the values to spanish ones. Beware, there are a LOT!
There might be more pitfalls, but those are the ones, that came to my mind.

Changing the frontend language & multiple countries support in Shopware

So, I'm trying to understand how this E-Commerce solution works. I have installed the Community Edition and added the default shop. Everything is fine. I read in the Shopware documentation that you can add multiple languages to the web shop by creating additional shops and configuring them as Language Shops. All is fine, that worked, I now have two websites.
Problem is - even though the localisation information is set to Romanian - the website is all in German. Do I really need to purchase the language packs that are offered in the Shopware store? Or can I change the text manually? If so, how do you do that? Also, apparently the flag for the selected language is off... I have the Language Shop configured for RO, but it displays the shop as DE (Germany).
Also, can Shopware make a difference between selected languages when talking about product stock, prices and payment method? The idea is that depending on what country is selected, the product stock and price is changed. With this, the product code might get changed. Also, payment methods and accounts have to be changed as well. Can Shopware do that? If so, is there a tutorial or something regarding this? (I didn't really find something like this...)
Thanks for the help !
Crossposted at the Shopware Community Forum.
So many questions ... trying to sort this out:
As far as I know the backend is available in 2 languages only, German and Englisch.
Just changing the localisation will not change the language being used in the shop frontend. Changing the language is a complex thing to do, which require many aspects.
First of all, each subshop is assigned to a root category eg. 'German' or 'English' or 'Romanian' - this facilitates to show different stock in different languages. (Btw, do not delete the category Deutsch or German, it will break the system. If you don't need it, just leave it empty.)
Many of the predefined attributes and any custom defined attribute for articles can be translated.
Any other static text can be translated, as Shopware uses the Smarty template technology - very easy and straightforward to do.
Bottom line: No you do not need to buy the language packs, if you want to the translation yourself.
Prices can be set per customer group, subshops in turn are associated to customer groups, so this way you could show different prices in different regions/languages.

Are Excel's localized function names documented

Is there a reference of Excel's localized function names?
For example, the function "SUM" is "SOMME" in French and "SUMA" in Spanish.
Is there an exhaustive documentation somewhere?
There's a list of English/French/German function names here, or a comprehensive list of functions in 14 different languages
Brazilian Portuguese (português
brasileiro)
Czech (čeština)
Danish (dansk)
Dutch (nederlands)
Finnish (suomi)
French (français)
German (deutsch)
Hungarian (magyar)
Italian (italiano)
Norwegian (norsk)
Polish (język polski)
Portuguese (português)
Spanish (español)
Swedish (svenska)
here.
EDIT
I also have a set of Russian function names, though I'm not aware of any other translation sites with that set of data.
I'm always interested in other language lists if you manage to track any down.
EDIT 2
For some information about other localization issues, Ron de Bruin, Kirill Lapin and Hector Miguel Orozco Diaz have this excellent page that mentions a host of further localization differences.
EDIT 3
Russian function names are included in the Russian language files for PHPExcel. The full text is too big to post here, but You can find it in the source repository.
Yes.
A list of English function names is available from Microsoft here:
https://support.microsoft.com/en-us/office/excel-functions-alphabetical-b3944572-255d-4efb-bb96-c6d90033e188
If you change en-us in this URL to another language short code such as de-de, fr-fr or it-it, the page will be displayed in that language. All the Excel functions will also be shown in the selected language. For example, Italian is here:
https://support.microsoft.com/it-it/office/funzioni-di-excel-in-ordine-alfabetico-b3944572-255d-4efb-bb96-c6d90033e188
A list of language short codes (technically 'BCP 47 codes', I believe) used by Microsoft is available here: https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a
(Not all of these are necessarily supported by the page above.)

How to compare different language String values in JAVA?

In my web application I am using two different Languages namely English and Arabic.
I have a search box in my web application in which if we search by name or part of the name then it will retrieve the values from DB by comparing the "Hometown" of the user
Explanation:
Like if a user belongs to hometown "California" and he searches a name say "Victor" then my query will first see the people who are having the same hometown "California" and in the list of people who have "California" as hometown the "Victor" *name* will be searched and it retrieve the users having "California" as their hometown and "victor" in their name or part of the name.
The problem is if the hometown "California" is saved in English it will compare and retrieve the values. But "California" will be saved as "كاليفورنيا" in Arabic. In this case the hometown comparison fails and it cant retrieve the values.
I wish that my query should find both are same hometown and retrieve the values. Is it possible?
What alternate I should think of for this logic for comparison. I am confused. Any suggestion please?
EDIT:
*I have an Idea such that if the hometown is got then is it possible to use Google translator or transliterator and change the hometown to another language. if it is in english then to arabic or if it is in english then to arabic and give the search results joining both. Any suggestion?*
The problem you encounter is that you want / need information in 2 or more languages and you want the user of your application to be able to use both languages. One possible approach is to keep multiple records per item and including a language code as part of the primary key, for instance if your record is
id hometown name
001 California Victor
you could introduce a language code and store
id lang hometown name
001 en California Victor
001 ar كاليفورنيا Victor
then your search would match either "California" or "كاليفورنيا" giving you the id 001, which you can then use to load all translations of your data (or just the data in the current output language.) This sceme can be used with any number of languages and has the added advantage that you don't need to prefill the table. You can add new translations for records when they become known.
(Caveat: I just repeated your arabic string, I can't read it, also 'ar' most likely isn't the correct language code for aribic but you get the idea.)
Does the Arabic sound like "California"? If so you will need to compare on a "sounds-like"-basis which will most likely result in a phoneme conversion.
Transliterate all names into the same language (e.g. English) for searching, and use Levenstein edit distance to compute the similarity between the phonetic representations of the names. This will be slow if you simply compare your query with every name, but if you pre-index all of the place names in your database into a Burkhard-Keller tree, then they can be efficiently searched by edit distance from the query term.
This technique allows you to sort names by how close they actually match. You're probably more likely to find a match this way than using metaphone or double-metaphone, though this is more difficult to implement.
Your Google suggestion sounds like it might also be a good one, but you should play around with it, and be sure that you're happy with its accuracy. In testing how it worked going between Hebrew and English, I noticed that sometimes Google just leaves English place names in English letters when translating to Hebrew.
How about you use some localization on client side to display values. Or create a wrapper class for hometown that will override equal(Object) in the manner the instance for California will return true for both "California" and "كاليفورنيا" (sorry if I made mistake here, just copy-pasted from above).
This sounds like a classic encoding problem. Whenever you transfer non-ascii character you need to make sure you're encoding it right. For Arabic and English I suspect you can use UTF-8 (but I don't know arabic, so it may be wrong).
In your setup you will probably have the following points:
Browser <-> Servlet container <-> Database
|
System.out
In any of the system interfaces where chars (16-bit) are converted to byte (8-bit) you will need to make sure the encoding is correct.
Browser to Servlet container
When you do GET or POST requests from a web-page, the browser will look at 1) The HTTP headers from the server, especially the Content-Type: text/html; charset=UTF-8, which if present, will override the HTML meta header <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">.
On the servlet container side, the HttpServletRequest.getParameter(), will have an encoding that you most likely need to set in the server settings.
Example tomcat's server.xml
<Connector port="8080" protocol="HTTP/1.1" URIEncoding="UTF-8"
maxThreads="2000"
connectionTimeout="20000"
redirectPort="8443" />
Servlet container to Database
The database needs to have the correct encodings, or sorting etc will not be right.
Example my.cnf for MySQL
[mysqld]
....
init_connect=''SET collation_connection = utf8_general_ci''
init_connect='SET NAMES utf8'
default-character-set=utf8
character-set-server = utf8
collation-server = utf8_general_ci
[mysql]
....
default-character-set=utf8
Then the JDBC-driver needs to be set for UTF-8.
Example JDBC connect string
jdbc:mysql://localhost:3306/rimario?useUnicode=true&characterEncoding=utf-8
System.out
System.out.printnln() can not be relied upon to verify things. First it depends on the java vm default encoding, set using System.property -Dfile.encoding=UTF-8, secondly the terminal in which you do the System.out, will need to be set to and support UTF-8. Don't trust System.out!
Once a String in the VM is a proper character, it will not be affected by encoding. In memory every char in a string is 16-bit, which (almost) covers all the chars that utf-8 can encode. You can write the string to a file and investigate the file to really know if you got correct chars in your VM.

Resources