Is there any way to get language+country combinati...
# suitecommerce
c
Is there any way to get language+country combinations like en-FR supported by the Item Search API?
Copy code
/api/items?c=6260549_SB1&language=en&country=FR&currency=USD&fieldset=search&n=2&pricelevel=5&use_pcv=F
Even though I have English (International) enabled in both General Preferences and on the Website Setup Record, the following, the following returns:
Copy code
{
  "errors": {
    "language and country": "must identify a language associated with this site"
  },
  "code": 400
}
If I use
language=fr&country=FR
or
language=en&country=US
, then I get a proper 200 with results. Just not for combos like
en-FR
. What am I missing here?
s
Stepping back a bit, I'm not entirely sure what it is you want to do as a whole but you should know that we don't support multiple languages on a single site. If you want to set up a domain to use a language different from what is in the website setup record, you will need to add a separate domain and then add in the languages to the Hosts section of the domain configuration record
The value for
language
and
country
in the requests to the API will be automatically determined from the language/locale code that is set in that field. Eg, I have a test domain set up with the language set to es_AR which means that it will use Latin American Spanish and Argentina as the country automatically
c
@Steve Goldberg Interesting... do you mean to say that I can have multiple languages if I have one language per domain? Just not multiple languages on a single domain? Also, do you happen to know which countries the
English (International)
language encompasses?
s
Yes, a domain can only have one language but you can have as many domains as you want (within your licence limits obvs).
As for 'international English', it is an US-centric definition and so generally refers to those outside of it (eg UK and Australia).
Eg, UK, Ireland, India, Australia, NZ all typically use -ise rather than -ize.
c
Got it, thanks! cc @Keith Fetterman
k
@Steve Goldberg, in regards to the International English language, which countries does it work with? I tried to get it to work with country Germany, and I get a 400 error from the Item Search API. For example:
Copy code
/api/items?c=6260549_SB1&language=en&country=DE
Shouldn’t the International English language work for any country except for the country specific languages, like AU, CA, UK, etc? We have “English (International)” configured in the General Preferences and selected in the website setup record.
I also don’t see anywhere in the NetSuite help documentation that says a language is country specific. It seems like NetSuite will only display the German language for the country Germany and not any other country.
I configured an SCA website that has two domains associated with the website setup record. One domain is configured for en_US and the other domain is configured for en_DE. As I mentioned above, International English language is configured for the account and selected for the website record. I even selected it as the default language for the website. I then configured the hosts appropriately in the Multi-Domain tab in configuration for both domains. When I try to display the domain that has en_DE configured, I get the following error:
Copy code
Notice (SuiteScript)
 
en_DE is not a valid value for field site language.
@Steve Goldberg, are we missing something? Thanks for the help.
s
Prices, languages, localisation and offering them to web stores is really complicated. I gave a simple answer to his question and it has now morphed into something bigger. So I will try to answer as best I can. So, en_DE is not a valid code because it is not a valid language code. The code must be the language and then a country or region that has a localisation of that language. Germany doesn't explicitly have a 'local' version of English, so you if you run a German site, you will need to either offer them content in German (eg German German) or a form of English, or indeed any other language so long as it is a valid language code. If you want to offer them prices in their local currencies, we don't offer country localised prices out of the box (although I'm sure you could do interesting things with price lists, customer groups, etc). No, you would offer them prices in a currency that you're happy to accept them in. Let's say euros. Those euros prices will be the same for everyone who wants to pay in euros, so you couldn't (again, straight-forwardly) offer Germans one price and French people a different one. Items have data in specific languages and prices in specific currencies -- they do not have 'people in Germany see this content' and 'people in Germany see these prices'.
If you have an American domain and German domain, and you want to offer them content in English, then it would seem to me that you should just use en_US for both. If you want to offer Americans prices in USD and Germans in EUR, then you can set the domains up that way.
If you say "well what if I offer my German site in German but I want people who use it to also be able to use English on that domain" well, that's where we start to hit limitations. As I said, domains should not have more than one language. In my experience, the language selector doesn't work well enough to offer multiple languages on a site, and you will likely have SEO problems as I don't think the site code is properly set up to deal with multiple languages on the same domain, so you may issues where, for example, the language code on the HTML element says the wrong language.
If this doesn't work for you, let me know exactly what your use cases are and I can make a note of them.
k
@Steve Goldberg, sorry for the long delay. Slack didn’t tell me that you had responded. Thank you for the detailed explanations. Since the NetSuite doesn’t specifically mention that there are limits to specific country and language combinations, I made some assumptions. The help mentions languages, but doesn’t reference countries related to the language unless the language has a country associated with it. Given that, I had assumed that the International English would work with any country that didn’t have a specific country associated with the language, for example Canadian English. I ran some tests to see if the native language for a given country would work with the Item Search API, and in some cases they don’t. For example, the Item Search API does not support New Zealand English (en_NZ) and Mexico Spanish (es_MX). I get 400 errors. According to NetSuite help, these are valid Locales: https://netsuite.custhelp.com/app/answers/detail/a_id/69647/kw/locale In my website setup record, I have all of the english languages configured and both the Español (Latinoamérica) and Español (España).
s
That list ... is not something I have seen before. My understanding regarding languages is that we can only support the ones that we have dictionaries for. You can see the lists here: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_N247147.html
To use your examples: New Zealand English and Mexican Spanish are Not A Thing
k
yes and no. What do they mean by English (International) and Spanish (Latin America)? These are not country specific. It seems to me that there is no way to access these dictionaries.
The list I referenced was related to Currencies, so it may not apply to language/country support.
s
I believe we use es_AR for Latin American Spanish
Advanced > Shopping Application > Languages
k
In regards to the help page that you shared, https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_N247147.html, it doesn’t say the languages are country dependent thus the confusion. In regards to “Advanced > Shopping Application > Languages”, I assume this is the SC Configuration page. Does the Item Search API access or use the SC Configuration in any way? I had assumed it didn’t.
s
Sorry, I got distracted and should have fleshed out that comment more: Advanced > Shopping Application > Languages refers to the location of the SCA dictionaries in the core code
And yeah, I don't think we explicitly document the country:language connection
k
Okay. Makes sense. I think the only issue we have is the Item Search API itself.
s
Yeah so I am still confused about exactly what it is you want to do
Setting up a site to have 10, 15, 20+ languages is very unusual
It reminds me of a customer who had wanted to set up domains for every possible market they could sell to simply for the sake of it, rather than offering any sort of localisation to those customers
k
Sorry. Our original question was related to the country and language of the Item Search API. In regards to your comment “Setting up a site to have 10, 15, 20+ languages is very unusual”, no kidding. I have never worked on such a complex project.
In regards to the Item Search API, we are trying to get item field translations from the API for countries, like Germany/English, New Zealand/English, Mexico/Spanish etc. It returns 400 error saying “`{"errors":{"language and country":"must identify a language associated with this site"},"code":400}`” even though the English (International) and Spanish (Latin America) languages are defined in the website setup record. We were wondering if we missed something in the NetSuite configuration, but it doesn’t seem like it. It seems this is a limitation of the Item Search API. It looks like we’ll have to build a map of Locales for the country/languages that are returning 400 errors from the Item Search API. For example, for Germany/English, we’ll use en_US, for New Zealand/English, we’ll either use en_US or en_AU, and Mexico/Spanish es_AR. If we need country specific item field translations for a specific language, we’ll need to implement custom fields. Thanks for the help and sticking with this thread.