completion

This commit is contained in:
2025-08-06 13:49:11 +08:00
commit c2d7317897
684 changed files with 92987 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
/* global jest: true */
// https://github.com/react-native-community/react-native-localize/blob/master/README.md#how-to-test-your-code
const getLocales = () => [
// you can choose / add the locales you want
{
countryCode: 'US',
languageTag: 'en',
languageCode: 'en',
isRTL: false,
},
{
countryCode: 'DE',
languageTag: 'de',
languageCode: 'de',
isRTL: false,
},
{
countryCode: 'JA',
languageTag: 'ja',
languageCode: 'ja',
isRTL: false,
},
];
// use a provided translation, or return undefined to test your fallback
const findBestAvailableLanguage = () => ({
languageTag: 'en',
isRTL: false,
});
const getNumberFormatSettings = () => ({
decimalSeparator: '.',
groupingSeparator: ',',
});
const getCalendar = () => 'gregorian'; // or 'japanese', 'buddhist'
const getCountry = () => 'US'; // the country code you want
const getCurrencies = () => ['USD', 'EUR']; // can be empty array
const getTemperatureUnit = () => 'celsius'; // or 'fahrenheit'
const getTimeZone = () => 'Europe/Paris'; // the timezone you want
const uses24HourClock = () => true;
const usesMetricSystem = () => true;
const addEventListener = jest.fn();
const removeEventListener = jest.fn();
export {
findBestAvailableLanguage,
getLocales,
getNumberFormatSettings,
getCalendar,
getCountry,
getCurrencies,
getTemperatureUnit,
getTimeZone,
uses24HourClock,
usesMetricSystem,
addEventListener,
removeEventListener,
};