generated from Seekra/repository-template
Load the default language on startup #133
+11
-10
@@ -14,20 +14,21 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue';
|
||||||
import App from './App.vue'
|
import App from './App.vue';
|
||||||
import { i18n, loadLanguage } from './i18n'
|
import { i18n, loadLanguage, fallbackLocale } from './i18n';
|
||||||
import getCurrentLanguage from './utils/currentLanguage'
|
import getCurrentLanguage from './utils/currentLanguage';
|
||||||
import router from './router'
|
import router from './router';
|
||||||
|
|
||||||
import './styles/common.css'
|
import './styles/common.css';
|
||||||
import './styles/variables/colors.css'
|
import './styles/variables/colors.css';
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
await loadLanguage(getCurrentLanguage())
|
await loadLanguage(fallbackLocale);
|
||||||
|
jakob.scheid marked this conversation as resolved
Outdated
|
|||||||
|
await loadLanguage(getCurrentLanguage());
|
||||||
|
|
||||||
|
jakob.scheid marked this conversation as resolved
Outdated
jakob.scheid
commented
This check is not necessary. This check is not necessary. `loadLanguage` already checks whether a language has already been loaded. If the language preferred by the user is the same as the fallback language, it is not redundantly fetched.
|
|||||||
createApp(App)
|
createApp(App)
|
||||||
.use(router)
|
.use(router)
|
||||||
.use(i18n)
|
.use(i18n)
|
||||||
.mount('#app')
|
.mount('#app');
|
||||||
})()
|
})();
|
||||||
Reference in New Issue
Block a user
Please use a semicolon at the end of the line.
I will fix that.