There is a "code" for language (English, Spanish, etc...) not defined?
Asked Answered
S

3

9

In my application there is language detection. Languages have some identification code like en for English, pt for Portuguese, fr for French, etc.

Is there a language code for the case when a language cannot be identified (unknown language)?

Setting answered 31/3, 2012 at 3:4 Comment(0)
B
5

The language codes you're using look like ISO 639-1. There is no ISO 639-1 code for an indeterminate or unknown language; however, "xx" could be used as as a reasonable placeholder.

Bilection answered 31/3, 2012 at 3:9 Comment(0)
O
9

If your system allows for three-letter codes, the ISO 639-2 standard says:

If there is language content, but the specific language cannot be determined, a special identifier is provided by ISO 639-2:

und (Undetermined)

Orb answered 11/2, 2015 at 0:42 Comment(1)
fun fact: in the german language, und means "and"Trometer
B
5

The language codes you're using look like ISO 639-1. There is no ISO 639-1 code for an indeterminate or unknown language; however, "xx" could be used as as a reasonable placeholder.

Bilection answered 31/3, 2012 at 3:9 Comment(0)
L
1

You probably know it already, but at least for the benefit of others who may look your question up later:

In C, C++ and Unix/Linux generally, and sometimes elsewhere, there is something that goes by the cryptic name of "the C locale." This is really the absence of a locale, which is to say, the absence of a set of language- and country-related conventions. In the C locale, text is sorted in straight character-code (usually ASCII) order, which means that "ABC" precedes "XYZ" precedes "abc" precedes "xyz."

One needn't specify any code at all to get the C locale. It has no code -- a significant fact which is at least tangentially related to your question.

Lohse answered 31/3, 2012 at 3:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.