Returns the closest match for the given locale codes. We iterate over all given locale codes in order. If we have a tight or a loose match for the code (e.g., "en" for "en_US"), we return the locale. Otherwise we move to the next code in the list. By default we return ``en_US`` if
(*locale_codes: str)
| 60 | |
| 61 | |
| 62 | def get(*locale_codes: str) -> "Locale": |
| 63 | """Returns the closest match for the given locale codes. |
| 64 | |
| 65 | We iterate over all given locale codes in order. If we have a tight |
| 66 | or a loose match for the code (e.g., "en" for "en_US"), we return |
| 67 | the locale. Otherwise we move to the next code in the list. |
| 68 | |
| 69 | By default we return ``en_US`` if no translations are found for any of |
| 70 | the specified locales. You can change the default locale with |
| 71 | `set_default_locale()`. |
| 72 | """ |
| 73 | return Locale.get_closest(*locale_codes) |
| 74 | |
| 75 | |
| 76 | def set_default_locale(code: str) -> None: |
nothing calls this directly
no test coverage detected