Skip to main content

countryAdjective

Converts the input country name to its adjective form.

Parameters

  • COUNTRY (string)

    The input country name.

Notes

  • The input string is not recognized unless it appears on Studio's in-built list of countries.

  • The input string is not recognized when it includes 'the' as a determiner (e.g. 'the Netherlands').

  • To test if the input value is recognized, use the isCountry function.

  • If the input string is not recognized, the function returns the string (unchanged) with a minor warning.

Examples

ATL in Script

Result

[[countryAdjective('China')]]

Chinese

[[countryAdjective('France')]]

French

[[countryAdjective('Netherlands')]]

Dutch

[[countryAdjective('United Kingdom')]]

British

[[countryAdjective('Turkmenistan')]]

Terkman

[[countryAdjective('Mozambique')]]

Mozambican

[[countryAdjective('Liechtenstein')]]

Liechtensteiner

[[countryAdjective('Saint Vincent And the Grenadines')]]

Saint Vincentian

Minor warning scenarios

ATL in Script

Result

Minor Warning

[[countryAdjective('España')]]

España'

'España' is not recognized as a country name.

[[countryAdjective('Freedonia')]]

Freedonia

'Freedonia' is not recognized as a country name.

When the function does NOT recognize the input value, it returns that value (unchanged) with a minor warning. The warning may prompt you to check that you've passed in the correct value and haven't made a mistake.

If you know your data contains non-recognized names (e.g. non-English spellings), you might want to avoid generating the minor warning. To do this, use isCountry to test the name. For example, you can create a user-defined function (UDF) that returns a non-recognized value (unchanged) but WITHOUT the minor warning.

  1. Create a script and name it countryAdj.

  2. Add the following content:

    #value countryAdj(countryName)
    
    [[isCountry(countryName) ? countryAdjective(countryName) : countryName]]
    

    This content creates a UDF called countryAdj. The UDF takes one parameter (countryName), to which you input a country name in STRING form. The UDF uses the isCountry function to check if the country name is recognized. If true, the UDF converts the name using the countryAdjective function; if false, the UDF returns the input value unchanged. There is no minor warning.

  3. Try calling the UDF in another script. For example:

    ATL in Script

    Result

    Minor Warning

    [[countryAdj('España')]]

    España

    N/A

    [[countryAdj('Freedonia')]]

    Freedonia

    N/A

    [[countryAdj('the Republic of Freedonia')]]

    the Republic of Freedonia

    N/A

    [[countryAdj('Netherlands')]]

    Dutch

    N/A

    [[countryAdj('the Netherlands')]]

    the Netherlands

    N/A

    [[countryAdj('United States of America')]]

    American

    N/A

    [[countryAdj('the United States of America')]]

    the United States of America

    N/A