GlobalObjects
Loading...
Searching...
No Matches
eut::LanguageFunctions Namespace Reference

Help functions to support different languages. More...

Enumerations

enum  EnLanguageKey {
  eUNDEFINED = 0 , eDEU_1 , eDEU_2 , eAUT ,
  eFRA , eDNK , eNOR , eFIN ,
  eSWE , eISL , eEST , eGBR ,
  eUSA , eENUM_SIZE
}
 

Functions

__tool_export_dll int changeLanguageChar (std::string &rsText, const std::vector< LanguageFunctions::EnLanguageKey > &rLanguageKeys)
 
__tool_export_dll int changeLanguageChar (std::string &rsText, LanguageFunctions::EnLanguageKey eLanguageKey)
 
__tool_export_dll std::string getLanguageIsoCodeByNum (EnLanguageKey eLanguageKeyNum)
 
__tool_export_dll LanguageFunctions::EnLanguageKey getLanguageKeyAsEnum (const std::string &rsLanguageKey)
 
__tool_export_dll unsigned int getLanguageKeyCount ()
 
__tool_export_dll std::string toUpperString (const std::string &rsSourc)
 

Detailed Description

Help functions to support different languages.

Author
Helmut Jakoby

Enumeration Type Documentation

◆ EnLanguageKey

Enumerations for countries or language codes to enable country-specific sorting.

Enumerator
eUNDEFINED 

Undefined.
String equivalent = "UNDEFINED"

eDEU_1 

Sort key for the German language in Germany. Sorting according to DIN 5007-1
String equivalent = "DEU-1"

  • 'ä' -> 'a'
  • 'ö' -> 'o'
  • 'ü' -> 'u'
  • 'Ä' -> 'A'
  • 'Ö' -> 'O'
  • 'Ü' -> 'U'
  • 'ß' -> 'ss'
eDEU_2 

Sort key for the German language in Germany. Sorting according to DIN 5007-2
String equivalent = "DEU-2"

  • 'ä' -> 'ae'
  • 'ö' -> 'oe'
  • 'ü' -> 'ue'
  • 'Ä' -> 'AE'
  • 'Ö' -> 'OE'
  • 'Ü' -> 'UE'
  • 'ß' -> 'ss'
eAUT 

Sort key for the German language in Austria.
String equivalent = "AUT"

  • 'ä' -> 'a{' (comes after 'az')
  • 'ö' -> 'o{'
  • 'ü' -> 'u{'
  • 'Ä' -> 'A['
  • 'Ö' -> 'O['
  • 'Ü' -> 'U['
  • 'ß' -> 'ss{'
  • 'St.' -> 'Sankt {'
eFRA 

Sort key for the French language in France.
String equivalent = "FRA"

  • 'à' -> 'a{'
  • 'â' -> 'a}'
  • 'æ' -> 'a~'
  • 'ç' -> 'c{'
  • 'è' -> 'e{'
  • 'é' -> 'e}'
  • 'ê' -> 'e~'
  • 'ë' -> 'e{}'
  • 'î' -> 'i{'
  • 'ï' -> 'i}'
  • 'ô' -> 'o{'
  • 'œ' -> 'o}'
  • 'ù' -> 'u{'
  • 'û' -> 'u}'
  • 'ü' -> 'u~'
  • 'ÿ' -> 'y{'
  • 'À' -> 'A['
  • 'Â' -> 'A]'
  • 'Æ' -> 'A^'
  • 'Ç' -> 'C['
  • 'È' -> 'E['
  • 'É' -> 'E]'
  • 'Ê' -> 'E^'
  • 'Ë' -> 'E[]'
  • 'Î' -> 'I['
  • 'Ï' -> 'I]'
  • 'Ô' -> 'O['
  • 'Œ' -> 'O]'
  • 'Ù' -> 'U['
  • 'Û' -> 'U]'
  • 'Ü' -> 'U^'
  • 'Ÿ' -> 'Y['
eDNK 

Sort key for the Danish language in Denmark.
String equivalent = "DNK"

eNOR 

Sort key for the Norwegian language. Same as eDNK.
String equivalent = "NOR"

eFIN 

Sort key for the Finnish language.
String equivalent = "FIN"

  • 'å' -> 'z{' (comes after 'z')
  • 'ä' -> 'z}' (comes after 'z{')
  • 'ö' -> 'z~' (comes after 'z}')
  • 'ü' -> 'y'
  • 'Å' -> 'Z['
  • 'A' -> 'Z]'
  • 'Ö' -> 'Z^'
  • 'Ü' -> 'Y'
eSWE 

Sort key for the Swedish language. Same as eFIN.
String equivalent = "SWE"

eISL 

Sort key for the Icelandic language.
String equivalent = "ISL"

  • 'á' -> 'a{'
  • 'ð' -> 'd{'
  • 'é' -> 'e{'
  • 'í' -> 'i{'
  • 'ó' -> 'o{'
  • 'ú' -> 'u{'
  • 'ý' -> 'y{'
  • 'þ' -> 'z{'
  • 'æ' -> 'z}'
  • 'ö' -> 'z~'
  • 'Á' -> 'A['
  • 'Ð' -> 'D['
  • 'É' -> 'E['
  • 'Í' -> 'I['
  • 'Ó' -> 'O['
  • 'Ú' -> 'U['
  • 'Ý' -> 'Y['
  • 'Æ' -> 'Z['
  • 'Ö' -> 'Z]'
eEST 

Sort key for the Estonian language.
String equivalent = "EST"

  • 'š' -> 's{'
  • 'z' -> 's}'
  • 'ž' -> 's~'
  • 'õ' -> 'v{'
  • 'å' -> 'v}'
  • 'ä' -> 'v~'
  • 'ö' -> 'v{{'
  • 'ü' -> 'v{}'
  • 'Š' -> 'S['
  • 'Z' -> 'S]'
  • 'Ž' -> 'S^'
  • 'Õ' -> 'V['
  • 'Å' -> 'V]'
  • 'Ä' -> 'V^'
  • 'Ö' -> 'V[['
  • 'Ü' -> 'V[]'
eGBR 

Sort key for the English language in Great Britain.
There are no conversions.
String equivalent = "GBR"

eUSA 

Sort key for the English language in the USA.
There are no conversions.
String equivalent = "USA"

eENUM_SIZE 

With this enum you get the number of supported types. MUST be last!

Function Documentation

◆ changeLanguageChar() [1/2]

__tool_export_dll int eut::LanguageFunctions::changeLanguageChar ( std::string & rsText,
const std::vector< LanguageFunctions::EnLanguageKey > & rLanguageKeys )

Converts all country-specific characters according to the language key transferred. Several language keys can be transferred, which are processed in sequence.

Parameters
[in,out]rsTextThe text in which the country-specific characters are exchanged.
[in]rLanguageKeysThe language keys in a vector. Several sort keys can be passed in the vector, they are processed one after the other.
Returns
A return value > 0 is the number of exchanged characters. A return value == 0 indicates that nothing was exchanged.

◆ changeLanguageChar() [2/2]

__tool_export_dll int eut::LanguageFunctions::changeLanguageChar ( std::string & rsText,
LanguageFunctions::EnLanguageKey eLanguageKey )

Converts all country-specific characters according to the language key transferred.

Parameters
[in,out]rsTextThe text in which the country-specific characters are exchanged.
[in]eLanguageKeyThe language key.
Returns
A return value == ERR_WRONG_TYPE indicates that the transferred language is not supported. A return value > 0 is the number of characters exchanged. A return value == 0 indicates that nothing was exchanged.

Translated with www.DeepL.com/Translator (free version)

◆ getLanguageIsoCodeByNum()

__tool_export_dll std::string eut::LanguageFunctions::getLanguageIsoCodeByNum ( EnLanguageKey eLanguageKeyNum)

Returns the language key as string that matches the passed enumeration value or "UNDEFINED" if no match exists.

Parameters
[in]eLanguageKeyNumThe enumeration value of the language key.
Returns
The language key as string.

◆ getLanguageKeyAsEnum()

__tool_export_dll LanguageFunctions::EnLanguageKey eut::LanguageFunctions::getLanguageKeyAsEnum ( const std::string & rsLanguageKey)

Returns the language key as enumeration.

Parameters
[in]rsLanguageKeyThe language key as QString.
Returns
The language key as enumeration.

◆ getLanguageKeyCount()

__tool_export_dll unsigned int eut::LanguageFunctions::getLanguageKeyCount ( )

Returns the number of supported language keys.

Returns
The number of supported language keys.

◆ toUpperString()

__tool_export_dll std::string eut::LanguageFunctions::toUpperString ( const std::string & rsSourc)

Converts the characters in the passed string to upper case. Here special with the characters:

  • '{' -> '['
  • '}' -> ']'
  • '~' -> '^'
    Parameters
    [in]rsSourcThe string.
    Returns
    The string converted to upper case.