<commit_before>import Vue from 'vue';
import Axios from 'axios';
import {
	TranslationLangs,
	getTranslationLang,
} from '../lib/gj-lib-client/components/translate/translate.service';

const VueGettext = require('vue-gettext');

export async function bootstrapAppTranslations() {
	const availableLanguages: any = {};
	for (const _lang of TranslationLangs) {
		availableLanguages[_lang.code] = _lang.label;
	}

	let lang = getTranslationLang();

	let translations: any = {};
	if (GJ_IS_SSR) {
		translations = require('../translations/en_US/main.json');
	} else {
		// Don't use webpack to require directly. If we did it would generate new
		// files for each section that we built for.
		const response = await Axios({
			url: require('!file-loader!../translations/' + lang + '/main.json'),
			ignoreLoadingBar: true,
		});
		translations = response.data;<commit_msg>fix translations for ssr<commit_after>import Vue from 'vue';
import Axios from 'axios';
import {
	TranslationLangs,
	getTranslationLang,
} from '../lib/gj-lib-client/components/translate/translate.service';

const VueGettext = require('vue-gettext');

export async function bootstrapAppTranslations() {
	const availableLanguages: any = {};
	for (const _lang of TranslationLangs) {
		availableLanguages[_lang.code] = _lang.label;
	}

	let lang = getTranslationLang();

	let translations: any = {};
	if (GJ_IS_SSR) {
		translations = require('!json-loader!../translations/en_US/main.json');
	} else {
		// Don't use webpack to require directly. If we did it would generate new
		// files for each section that we built for.
		const response = await Axios({
			url: require('!file-loader!../translations/' + lang + '/main.json'),
			ignoreLoadingBar: true,
		});
		translations = response.data;
{'fraction_non_alphanumeric': 0.13139931740614336, 'fraction_numerical': 0.0, 'mean_word_length': 4.3465045592705165, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2196272', 'n_tokens_mistral': 577, 'n_tokens_neox': 544, 'n_words': 150}