remove redundant parameter from Lang()
This commit is contained in:
		
							parent
							
								
									1b25e56d0a
								
							
						
					
					
						commit
						7db5ec7fae
					
				
					 24 changed files with 29 additions and 36 deletions
				
			
		|  | @ -3,7 +3,7 @@ import { parseEmoji, renderEmoji } from '$lib/emoji.js'; | |||
| import { get, writable } from 'svelte/store'; | ||||
| import Lang from '$lib/lang'; | ||||
| 
 | ||||
| const lang = Lang('en_GB'); | ||||
| const lang = Lang(); | ||||
| 
 | ||||
| const cache = writable({}); | ||||
| 
 | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ import { app_name } from '$lib/config.js'; | |||
| import { browser } from "$app/environment"; | ||||
| import Lang from '$lib/lang'; | ||||
| 
 | ||||
| const lang = Lang('en_GB'); | ||||
| const lang = Lang(); | ||||
| 
 | ||||
| const server_types = { | ||||
|     UNSUPPORTED: "unsupported", | ||||
|  |  | |||
|  | @ -1,25 +1,18 @@ | |||
| import * as en_GB from '@cf/lang/en_GB.json'; | ||||
| import * as ga_IE from '@cf/lang/ga_IE.json'; | ||||
| // import * as ga_IE from '@cf/lang/ga_IE.json';
 | ||||
| 
 | ||||
| /** | ||||
|  * @param {string} lang IETH language tag (i.e. en_GB) | ||||
|  * @returns Map<string, string | string[]> | ||||
|  */ | ||||
| export default function init(lang) { | ||||
| export default function init() { | ||||
|     let i18n = new Object(); | ||||
|     let language; | ||||
| 
 | ||||
|     // TODO: dynamic imports seem to fail here; it can't find the file.
 | ||||
|     // try {
 | ||||
|     //     language = import(`../lang/${lang}.json`);
 | ||||
|     // } catch (error) {
 | ||||
|     //     throw error;
 | ||||
|     // }
 | ||||
| 
 | ||||
|     language = en_GB; | ||||
|     // TODO: dynamic loading of language files
 | ||||
|     let language = en_GB; | ||||
|     let lang_code = 'en_GB'; | ||||
| 
 | ||||
|     i18n.lang = language; | ||||
|     i18n.lang_code = lang; | ||||
|     i18n.lang_code = lang_code; | ||||
|     i18n.string = function(/* @type string */ key, ...args) { | ||||
|         const tokens = key.split('.'); | ||||
|          | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| import Lang from '$lib/lang'; | ||||
| 
 | ||||
| const lang = Lang('en_GB'); | ||||
| const lang = Lang(); | ||||
| 
 | ||||
| import sound_log from '../sound/log.ogg'; | ||||
| import sound_hello from '../sound/hello.ogg'; | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| import Lang from '$lib/lang'; | ||||
| const lang = Lang('en_GB'); | ||||
| const lang = Lang(); | ||||
| 
 | ||||
| const denoms = [ | ||||
|     { unit: lang.string('time.second'), min: 0 }, | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ import Lang from '$lib/lang'; | |||
| 
 | ||||
| export const timeline = writable([]); | ||||
| 
 | ||||
| const lang = Lang('en_GB'); | ||||
| const lang = Lang(); | ||||
| 
 | ||||
| let loading = false; | ||||
| 
 | ||||
|  |  | |||
|  | @ -20,7 +20,7 @@ | |||
|     import FollowersVisIcon from '@cf/icons/followers.svg'; | ||||
|     import PrivateVisIcon from '@cf/icons/dm.svg'; | ||||
| 
 | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     export let reply_id; | ||||
| 
 | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ | |||
| 
 | ||||
|     import Logo from '$lib/../img/campfire-logo.svg'; | ||||
| 
 | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     let display_error = false; | ||||
|     let logging_in = false; | ||||
|  |  | |||
|  | @ -28,7 +28,7 @@ | |||
|     import FollowersIcon from '../../img/icons/followers.svg'; | ||||
| 
 | ||||
|     const VERSION = APP_VERSION; | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     const dispatch = createEventDispatcher(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -11,7 +11,7 @@ | |||
|     import ActionBar from '$lib/ui/post/ActionBar.svelte'; | ||||
|     import Lang from '$lib/lang'; | ||||
| 
 | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     let mention = (accounts) => { | ||||
|         let res = `<a href="/${$server.host}/${account.fqn}">${account.rich_name}</a>`; | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| <script> | ||||
|     import Lang from '$lib/lang'; | ||||
| 
 | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| </script> | ||||
| 
 | ||||
| <div id="widgets"> | ||||
|  |  | |||
|  | @ -20,7 +20,7 @@ | |||
| 
 | ||||
|     export let post; | ||||
| 
 | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     async function toggleBoost() { | ||||
|         if (!$app || !$app.token) return; | ||||
|  |  | |||
|  | @ -3,7 +3,7 @@ | |||
| 
 | ||||
|     export let post; | ||||
| 
 | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     let open = false; | ||||
| </script> | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ | |||
|     import RepostIcon from '@cf/icons/repost.svg'; | ||||
|     import Lang from '$lib/lang'; | ||||
| 
 | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     export let post; | ||||
| 
 | ||||
|  |  | |||
|  | @ -15,7 +15,7 @@ | |||
|     export let focused = false; | ||||
|     export let pinned = false; | ||||
| 
 | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     let post_context = undefined; | ||||
|     let post = post_data; | ||||
|  |  | |||
|  | @ -3,7 +3,7 @@ | |||
|     import { server } from '$lib/client/server'; | ||||
|     import Lang from '$lib/lang'; | ||||
| 
 | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     export let post; | ||||
|     export let reply = undefined; | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ | |||
|     import Lang from '$lib/lang'; | ||||
|     const dispatch = createEventDispatcher(); | ||||
| 
 | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     export let type = "react"; | ||||
|     export let label = lang.string('post.actions.react'); | ||||
|  |  | |||
|  | @ -13,7 +13,7 @@ | |||
|     import Composer from '@cf/ui/Composer.svelte'; | ||||
|     import Widgets from '$lib/ui/Widgets.svelte'; | ||||
| 
 | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     let show_composer = false; | ||||
| 
 | ||||
|  |  | |||
|  | @ -9,7 +9,7 @@ | |||
|     import Post from '$lib/ui/post/Post.svelte'; | ||||
|     import PageHeader from '../lib/ui/core/PageHeader.svelte'; | ||||
| 
 | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     account.subscribe(account => { | ||||
|         if (account) getTimeline(); | ||||
|  |  | |||
|  | @ -18,7 +18,7 @@ | |||
| 
 | ||||
|     export let data; | ||||
| 
 | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     let profile_pinned_posts = writable([]); | ||||
|     let profile_posts_max_id = null; | ||||
|  |  | |||
|  | @ -12,7 +12,7 @@ | |||
| 
 | ||||
|     export let data; | ||||
| 
 | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     let post = fetchPost(data.post_id); | ||||
|     let error = false; | ||||
|  |  | |||
|  | @ -12,7 +12,7 @@ | |||
| 
 | ||||
|     export let data; | ||||
| 
 | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     let auth_code = data.code; | ||||
| 
 | ||||
|  |  | |||
|  | @ -11,7 +11,7 @@ | |||
|     import CrossIcon from '../../img/icons/cross.svg' | ||||
|     import { get } from 'svelte/store'; | ||||
| 
 | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     async function actionRequest(account_id, approved) { | ||||
|         // remove item from array first - this updates the ui and | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ | |||
|     import PageHeader from '../../lib/ui/core/PageHeader.svelte'; | ||||
|     import Lang from '$lib/lang'; | ||||
| 
 | ||||
|     const lang = Lang('en_GB'); | ||||
|     const lang = Lang(); | ||||
| 
 | ||||
|     if (!$account) goto("/"); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue