Skip to content

Commit

Permalink
add gen alpha meme lang (I am sorry)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gcat101 committed Apr 16, 2024
1 parent 1ed6a5b commit c12216f
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 15 deletions.
68 changes: 68 additions & 0 deletions src/lang/_genalpha.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"name": "Gen Alpha Slang",

"errors.something_went_wrong": "Something went sus",
"errors.package_not_found": "Here, have a grimace shake, if that makes you feel any more skibidi: 🥤",
"errors.package_not_found.details": "Zesty fact: You can use '@author:name' to view packages made by a sigma. What 'bout using '@details' to get yap on each package?",
"errors.no_packages_published": "Looks like you don't have any sus packages published to KJSPKG. Ratio!",
"errors.automatin_down": "Our statistics database is not giving skibidi vibes",
"errors.automatin_down.details": "Rizz and fanum tax counts might be missing. Please yap this out to",
"errors.automatin_down.server": "our Ohio server",

"menu.language": "Yap",
"menu.theme": "Mewing",

"list.by": "by sigma",
"list.detailed.on_branch": "on branch",
"list.detailed.at_path": "at path",
"list.detailed.in_repo": "in repo",
"list.download_singluar": "rizz",
"list.download_plural": "rizz",
"list.view_singular": "fanum tax",
"list.view_plural": "fanum tax",

"author.owns": "has level",
"author.package_singular": "gyat",
"author.package_plural": "gyat",
"author.you": "drank grimace shake!",
"author.organizations": "Ohionizations",

"author.auth_required": "To access this mid page, you have to first ratio yourself through GitHub.",
"author.auth_required.login": "Touch grass",

"search.placeholder": "Glow-up some packages",
"search.package_singular": "gyat",
"search.package_plural": "gyat",
"search.found_singular": "Level <span>%d</span>",
"search.found_plural": "Level <span>%d</span>",
"search.matching": "giving",
"search.made_by": "made by sigma",
"search.detailed": "yapped out",

"search.show_details": "Show more yap",
"search.clear_filters": "Gatekeep filters",
"search.use_view.list": "Use yap view",
"search.use_view.compact": "Use skibidi view",

"search.sorted_by": "Looksmaxxing by",
"search.sort_type.name": "Ick (a-z)",
"search.sort_type.author": "Sigma name (a-z)",
"search.sort_type.downloads": "Rizz count",
"search.sort_type.views": "Fanum tax",
"search.sorted_by.name": "ick",
"search.sorted_by.author": "sigma name",
"search.sorted_by.downloads": "rizz",
"search.sorted_by.views": "fanum tax",

"package.created_by": "Created by sigma",
"package.available_for": "Hits different for",
"package.manage_package": "Rizz up the package (click to copy)",
"package.readme_file": "Yapping file",
"package.package_preview": "Kai senat preview",

"package.depends_on": "Simps for",
"package.incompatible_with": "Vibe checks",
"package.dependency.kjs_package": "Skibidi package",
"package.dependency.external_mod": "sus mod",
"package.dependency.mod_open_in": "See yap in"
}
27 changes: 15 additions & 12 deletions src/lib/HeaderBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import consts from './consts';
import { contextMenu, type ContextMenuItem } from './overlays/contextMenu';
import { currentScrollPosition, currentSearchStore, langKeyStore, userPreferencesStore } from './stores';
import { getLangKeys, getLangs, parseInputString } from './utils';
import { getLangKeys, getLangs, memeLangCount, parseInputString } from './utils';
import { fly } from 'svelte/transition';
import IconLogin from './IconLogin.svelte';
Expand All @@ -19,6 +19,19 @@
let searched = getQuery();
let langs = getLangs();
let langElements : ContextMenuItem[];
$: langElements = Object.keys(langs).map(lang => {
return {
type: 'ITEM',
label: langs[lang],
icon: $userPreferencesStore.locale == lang ? IconCheck : IconBlank,
action: () => {
$userPreferencesStore.locale = lang;
$langKeyStore = getLangKeys();
}
};
});
let inputElement: HTMLInputElement;
afterNavigate(() => (searched = getQuery()));
Expand All @@ -28,17 +41,7 @@
items: [
{ type: 'SEPARATOR', header: $langKeyStore['menu.language'] },
...Object.keys(langs).map(lang => {
return {
type: 'ITEM' as const,
label: langs[lang],
icon: $userPreferencesStore.locale == lang ? IconCheck : IconBlank,
action: () => {
$userPreferencesStore.locale = lang;
$langKeyStore = getLangKeys();
}
};
})
...[...[...langElements.slice(0, 1), { type: 'SEPARATOR' }, ...langElements.slice(1, (memeLangCount ? -memeLangCount : undefined))], ...(memeLangCount ? [{ type: 'SEPARATOR' }, ...langElements.slice(-memeLangCount)] : [])]
] as ContextMenuItem[]
};
$: themeContextMenu = {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ export const userPreferencesStore = localStorageStore<{
alreadyVisited: true
});

export const langKeyStore = writable<{ [key: string]: string }>(getLangKeys())
export const langKeyStore = writable<{ [key: string]: string }>(getLangKeys());
7 changes: 5 additions & 2 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { packageListStore, packageStatStore, packageStatusStore, userPreferences
// @ts-expect-error full exists, thanks crappy types
import { full as emoji } from 'markdown-it-emoji';

const langs = import.meta.glob("../lang/*.json", { eager: true, import: 'default' })
const langs = import.meta.glob('../lang/*.json', { eager: true, import: 'default' })
const md = markdownit({
html: false,
xhtmlOut: false,
Expand All @@ -21,9 +21,12 @@ const md = markdownit({
}
}).use(emoji);

export let memeLangCount = 0;
Object.keys(langs).forEach(l => {if (l.startsWith("../lang/_")) memeLangCount++});

export function getLangs(): { [key: string]: string } {
let langsWithNames : { [key: string]: string } = {};
for(let l of Object.keys(langs))
for(let l of Object.keys(langs).sort((a, b) => a=='../lang/en-US.json' ? -1 : (b.startsWith('../lang/_') ? -1 : 0)))
langsWithNames[l.split('/').at(-1)?.replace('.json', '') ?? ''] = (langs[l] as { [key: string]: string })['name'];
return langsWithNames;
}
Expand Down

0 comments on commit c12216f

Please sign in to comment.