It seems you're using Windows. The locale strings are different there. Take a more precise look at the doc:
locale.setlocale(locale.LC_ALL, 'de_DE') # use German locale; name might vary with platform
On Windows, I think it would be something like:
locale.setlocale(locale.LC_ALL, 'deu_deu')
MSDN has a list of language strings and of country/region strings
Answer from Schnouki on Stack OverflowIt seems you're using Windows. The locale strings are different there. Take a more precise look at the doc:
locale.setlocale(locale.LC_ALL, 'de_DE') # use German locale; name might vary with platform
On Windows, I think it would be something like:
locale.setlocale(locale.LC_ALL, 'deu_deu')
MSDN has a list of language strings and of country/region strings
You should not pass an explicit locale to setlocale, it is wrong. Let it find out from the environment. You have to pass it an empty string
import locale
locale.setlocale(locale.LC_ALL, '')
Locale settings are OS dependent and, at least on *nix systems, might even depend on whether they are installed or not.
This SO post might be a good pointer to what locales to use on Windows systems: https://stackoverflow.com/a/956084/2186184
add this in RobotFramework (at the beginning):
${osName}= Evaluate platform.system() platform
Run keyword if "${osName}"=='Windows' Evaluate locale.setlocale(locale.LC_ALL, 'french') locale
... ELSE Evaluate locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8') locale