Using the field "language_code" to set the language

Hello
I am trying to create a client from the API and setting the properties manually.
I successfully used the fields “country_code” and “currency_code” to send the ISO codes instead of the old way of getting the Id’s and they work well.
My problem is with the language, since I don’t know the id’s of the languages in InvoiceNinja and actually can’t find anyway to get them -a little bit tedious- I decided to use the same pattern “language_code” and whatever I send to this property there is no error but the language never get’s set.

for example I have tried to add a client with the language set as German so I have sent this in the request "language_code=“de” "
and in the response of the request it was to also stated that “language_code=“de”” but in the app it was not set and for the invoices the default language was used which is English.!

Is there anyway to get this to work since?
thank you

Hi,

Thanks for the suggestion!

cc @david

Any idea how I can get the table of the languages and their id? because for example I have a German customer and I want the invoice to be in German, but since the only property I can control is Language_id I have to know the Invoice Ninja Id for German and I don’t know where to get it from!

            {
                "id": "18",
                "name": "Albanian",
                "locale": "sq"
            },
            {
                "id": "30",
                "name": "Arabic",
                "locale": "ar"
            },
            {
                "id": "28",
                "name": "Chinese - Taiwan",
                "locale": "zh_TW"
            },
            {
                "id": "17",
                "name": "Croatian",
                "locale": "hr"
            },
            {
                "id": "16",
                "name": "Czech",
                "locale": "cs"
            },
            {
                "id": "9",
                "name": "Danish",
                "locale": "da"
            },
            {
                "id": "6",
                "name": "Dutch",
                "locale": "nl"
            },
            {
                "id": "1",
                "name": "English",
                "locale": "en"
            },
            {
                "id": "20",
                "name": "English - United Kingdom",
                "locale": "en_GB"
            },
            {
                "id": "35",
                "name": "Estonian",
                "locale": "et"
            },
            {
                "id": "23",
                "name": "Finnish",
                "locale": "fi"
            },
            {
                "id": "4",
                "name": "French",
                "locale": "fr"
            },
            {
                "id": "13",
                "name": "French - Canada",
                "locale": "fr_CA"
            },
            {
                "id": "3",
                "name": "German",
                "locale": "de"
            },
            {
                "id": "19",
                "name": "Greek",
                "locale": "el"
            },
            {
                "id": "2",
                "name": "Italian",
                "locale": "it"
            },
            {
                "id": "10",
                "name": "Japanese",
                "locale": "ja"
            },
            {
                "id": "32",
                "name": "Latvian",
                "locale": "lv_LV"
            },
            {
                "id": "14",
                "name": "Lithuanian",
                "locale": "lt"
            },
            {
                "id": "27",
                "name": "Macedonian",
                "locale": "mk_MK"
            },
            {
                "id": "8",
                "name": "Norwegian",
                "locale": "nb_NO"
            },
            {
                "id": "31",
                "name": "Persian",
                "locale": "fa"
            },
            {
                "id": "15",
                "name": "Polish",
                "locale": "pl"
            },
            {
                "id": "5",
                "name": "Portuguese - Brazilian",
                "locale": "pt_BR"
            },
            {
                "id": "21",
                "name": "Portuguese - Portugal",
                "locale": "pt_PT"
            },
            {
                "id": "24",
                "name": "Romanian",
                "locale": "ro"
            },
            {
                "id": "29",
                "name": "Russian (Russia)",
                "locale": "ru_RU"
            },
            {
                "id": "33",
                "name": "Serbian",
                "locale": "sr"
            },
            {
                "id": "34",
                "name": "Slovak",
                "locale": "sk"
            },
            {
                "id": "22",
                "name": "Slovenian",
                "locale": "sl"
            },
            {
                "id": "7",
                "name": "Spanish",
                "locale": "es"
            },
            {
                "id": "12",
                "name": "Spanish - Spain",
                "locale": "es_ES"
            },
            {
                "id": "11",
                "name": "Swedish",
                "locale": "sv"
            },
            {
                "id": "26",
                "name": "Thai",
                "locale": "th"
            },
            {
                "id": "25",
                "name": "Turkish - Turkey",
                "locale": "tr_TR"
            }

We’ll support this in the next release, note you’ll need to know our version of the locale. de is fine but french canadian’s require fr_CA

Thanks all.
I will use the provided table till the next release :slight_smile:

Could you please also send the table for the countries and currencies or at least a link that contains them, because I searched through the documentation but couldn’t find them.
Thank you

I tired pasting it here but it’s too long, we’ll look into adding it to the docs

cc @david

Okay could you please at least add the currency table since I need it the most right now.
Thank you

1 Like