mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	
							parent
							
								
									e19fbca300
								
							
						
					
					
						commit
						a5b5b94b43
					
				
					 2 changed files with 13 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -63,6 +63,13 @@ export default {
 | 
			
		|||
 | 
			
		||||
        (async function() {
 | 
			
		||||
            const locale = App.getPreferenceString("hl", App.defaultLangage);
 | 
			
		||||
            if (locale !== App.TimeAgoConfig.locale) {
 | 
			
		||||
                const localeTime = await import("javascript-time-ago/locale/" + locale + ".json").then(
 | 
			
		||||
                    module => module.default,
 | 
			
		||||
                );
 | 
			
		||||
                App.TimeAgo.addLocale(localeTime);
 | 
			
		||||
                App.TimeAgoConfig.locale = locale;
 | 
			
		||||
            }
 | 
			
		||||
            if (window.i18n.global.locale.value !== locale) {
 | 
			
		||||
                if (!window.i18n.global.availableLocales.includes(locale)) {
 | 
			
		||||
                    const messages = await import("@/locales/" + locale + ".json").then(module => module.default);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -225,6 +225,12 @@ const mixin = {
 | 
			
		|||
            return "en";
 | 
			
		||||
        },
 | 
			
		||||
    },
 | 
			
		||||
    data() {
 | 
			
		||||
        return {
 | 
			
		||||
            TimeAgo: TimeAgo,
 | 
			
		||||
            TimeAgoConfig: timeAgo,
 | 
			
		||||
        };
 | 
			
		||||
    },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const i18n = createI18n({
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue