We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8309d7f commit 4d81fcaCopy full SHA for 4d81fca
src/utils/toLocale.js
@@ -5,12 +5,12 @@ export default ({
5
}) => {
6
const l = $.i18n().locale;
7
$.i18n().locale = locale;
8
- let text;
9
try {
10
- text = $.i18n(id, ...data);
+ const text = $.i18n(id, ...data);
+ return text;
11
} catch {
12
- text = 'ERROR';
+ return 'ERROR';
13
+ } finally {
14
+ $.i18n().locale = l;
15
}
- $.i18n().locale = l;
- return text;
16
};
0 commit comments