mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 10:22:55 +08:00
feat: add new rule for floating promise (#2726)
Co-authored-by: Himself65 <himself65@outlook.com>
This commit is contained in:
@@ -68,15 +68,23 @@ const standardizeLocale = (language: string) => {
|
||||
|
||||
export const createI18n = () => {
|
||||
const i18n = i18next.createInstance();
|
||||
i18n.use(initReactI18next).init({
|
||||
lng: 'en',
|
||||
fallbackLng,
|
||||
debug: false,
|
||||
resources,
|
||||
interpolation: {
|
||||
escapeValue: false, // not needed for react as it escapes by default
|
||||
},
|
||||
});
|
||||
i18n
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
lng: 'en',
|
||||
fallbackLng,
|
||||
debug: false,
|
||||
resources,
|
||||
interpolation: {
|
||||
escapeValue: false, // not needed for react as it escapes by default
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
console.info('i18n init success');
|
||||
})
|
||||
.catch(() => {
|
||||
console.error('i18n init failed');
|
||||
});
|
||||
|
||||
i18n.on('languageChanged', lng => {
|
||||
localStorage.setItem(STORAGE_KEY, lng);
|
||||
|
||||
@@ -47,9 +47,9 @@ const getBaseTranslations = async (baseLanguage: { tag: string }) => {
|
||||
|
||||
const main = async () => {
|
||||
try {
|
||||
fs.access(RES_DIR);
|
||||
await fs.access(RES_DIR);
|
||||
} catch (error) {
|
||||
fs.mkdir(RES_DIR);
|
||||
fs.mkdir(RES_DIR).catch(console.error);
|
||||
console.log('Create directory', RES_DIR);
|
||||
}
|
||||
console.log('Loading project languages...');
|
||||
@@ -149,4 +149,7 @@ const main = async () => {
|
||||
console.log('Done');
|
||||
};
|
||||
|
||||
main();
|
||||
main().catch(e => {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
@@ -152,4 +152,7 @@ const main = async () => {
|
||||
// TODO send notification
|
||||
};
|
||||
|
||||
main();
|
||||
main().catch(e => {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user