mirror of
https://github.com/luxfi/pics.git
synced 2026-07-27 05:11:31 +00:00
First iteration of frontend optimized language pack files with ~70% reduced size from full pack
This commit is contained in:
+6
-1
@@ -471,10 +471,15 @@ const extraLocals = ${JSON.stringify({ meta: config.get.meta, reverseImageLinksU
|
||||
|
||||
await del([ 'static/js/lang/' ]);
|
||||
fs.mkdirSync(`${paths.scripts.dest}lang/`);
|
||||
const feStrings = require(__dirname+'/tools/festrings.json');
|
||||
Object.entries(i18n.getCatalog())
|
||||
.forEach(entry => {
|
||||
const [lang, dict] = entry;
|
||||
const langScript = `const LANG = ${JSON.stringify(dict)};`;
|
||||
const minimalDict = feStrings.reduce((acc, key) => {
|
||||
acc[key] = dict[key];
|
||||
return acc;
|
||||
}, {});
|
||||
const langScript = `const LANG = ${JSON.stringify(minimalDict)};`;
|
||||
fs.writeFileSync(`${paths.scripts.dest}lang/${lang}.js`, langScript);
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,208 @@
|
||||
["24h time",
|
||||
"Add",
|
||||
"Add layer",
|
||||
"ago",
|
||||
"Airbrush",
|
||||
"Always reveal text spoilers",
|
||||
"Appeal",
|
||||
"Appealable?",
|
||||
"Are you sure? Changing the canvas will clear all layers and history and disable replay recording.",
|
||||
"Are you sure? Your work will be lost.",
|
||||
"Attempting to reconnect...",
|
||||
"Banned!",
|
||||
"Blur",
|
||||
"Board",
|
||||
"Bucket",
|
||||
"Bumplocked",
|
||||
"Bypass",
|
||||
"Cache",
|
||||
"Canvas height in pixels",
|
||||
"Canvas width in pixels",
|
||||
"Captcha",
|
||||
"Captcha text",
|
||||
"Clear",
|
||||
"Close",
|
||||
"Code theme",
|
||||
"Color",
|
||||
"Connected for live posts",
|
||||
"Connected for live posts (%sms)",
|
||||
"Could not load the image.",
|
||||
"Could not load the replay: ",
|
||||
"Crisp image rendering",
|
||||
"Custom CSS",
|
||||
"Cyclic",
|
||||
"darkgray",
|
||||
"data-label",
|
||||
"Default name",
|
||||
"Delete layers",
|
||||
"Delete selected layers?",
|
||||
"Disable board custom CSS",
|
||||
"Disconnected",
|
||||
"Do NOT import untrusted settings data!",
|
||||
"Double click to highlight (%s)",
|
||||
"Double tap to highlight (%s)",
|
||||
"Download ",
|
||||
"Edit",
|
||||
"Eraser",
|
||||
"Error connecting",
|
||||
"Error reconnecting",
|
||||
"Expiry",
|
||||
"Export",
|
||||
"Failed reconnecting",
|
||||
"Faster",
|
||||
"Fetching posts...",
|
||||
"/file/",
|
||||
"Filter ID",
|
||||
"Filter Name",
|
||||
"Filter Subject",
|
||||
"Filter Tripcode",
|
||||
"Finish",
|
||||
"Flow",
|
||||
"focus to load captcha",
|
||||
"from now",
|
||||
"Gapless",
|
||||
"Global",
|
||||
"green",
|
||||
"Hidden images",
|
||||
"Hidden User",
|
||||
"Hide",
|
||||
"Hide deleted post content",
|
||||
"Hide post stubs",
|
||||
"Hide thumbnails",
|
||||
"Hover to view",
|
||||
"ID",
|
||||
"Image loading bars",
|
||||
"Import",
|
||||
"Import/Export Settings",
|
||||
"Invalid dimensions.",
|
||||
"IP/ID",
|
||||
"IPV4",
|
||||
"IPV6",
|
||||
"Issue Date",
|
||||
"Issuer",
|
||||
"Layer",
|
||||
"Layer limit reached.",
|
||||
"Layers",
|
||||
"Live posts",
|
||||
"Live posts off",
|
||||
"loading",
|
||||
"Loading replay…",
|
||||
"Local time",
|
||||
"Locked",
|
||||
"Loop audio/video",
|
||||
"Merge layers",
|
||||
"Merge selected layers?",
|
||||
"Message",
|
||||
"minimised",
|
||||
"Moderate",
|
||||
"Move down",
|
||||
"Move up",
|
||||
"Name",
|
||||
"Narrow",
|
||||
"New",
|
||||
"No active layer.",
|
||||
"No appeal submitted",
|
||||
"No Filters",
|
||||
"Non-color IDs",
|
||||
"Note",
|
||||
"Notifications",
|
||||
"No video/audio files in this thread.",
|
||||
"Now",
|
||||
"OK",
|
||||
"Only notify (You)s",
|
||||
"Opacity",
|
||||
"Open",
|
||||
"orange",
|
||||
"Pause",
|
||||
"Pen",
|
||||
"Pencil",
|
||||
"Pipette",
|
||||
"Play",
|
||||
"Playlist",
|
||||
"Please enable JavaScript to solve the captcha.",
|
||||
"Post Filters",
|
||||
".postmenu",
|
||||
"Post password",
|
||||
"Post(s)",
|
||||
"Posts not shown",
|
||||
"Preserve Alpha",
|
||||
"Pressure",
|
||||
"Pruned IP",
|
||||
"Range",
|
||||
"Reason",
|
||||
"Recording replay",
|
||||
"Recursive post hide",
|
||||
"red",
|
||||
"Redo",
|
||||
"Regex?",
|
||||
"removeAttribute",
|
||||
"Reverse",
|
||||
"Reverse Image Search",
|
||||
"Rewind",
|
||||
"Right click to replace with the current color",
|
||||
"%s",
|
||||
"Save",
|
||||
"Save As",
|
||||
"%s characters",
|
||||
"Scroll to new posts",
|
||||
"Seen?",
|
||||
"Select/Drop/Paste files",
|
||||
"setAttribute",
|
||||
"%s files",
|
||||
"%s files selected",
|
||||
"Show",
|
||||
"Show relative time",
|
||||
"Show (You)s",
|
||||
"Single",
|
||||
"Size",
|
||||
"Slower",
|
||||
"Smooth scrolling",
|
||||
"Socket error",
|
||||
"Spoiler",
|
||||
"Spoiler File",
|
||||
"%s replies",
|
||||
"Sticky",
|
||||
"Strip Filename",
|
||||
"Subject",
|
||||
"Submit",
|
||||
"Success",
|
||||
"%s UIDs",
|
||||
"Switch color palette",
|
||||
"Tegaki Size",
|
||||
"The active layer is not visible.",
|
||||
"Theme",
|
||||
"Thread watcher",
|
||||
"Thread Watcher",
|
||||
"thumb/",
|
||||
"Tip",
|
||||
"title",
|
||||
"title-mobile",
|
||||
"Toggle visibility",
|
||||
"Tone",
|
||||
"Tripcode",
|
||||
"Type",
|
||||
"undefined",
|
||||
"Undo",
|
||||
"Unlimit media height",
|
||||
"Updated",
|
||||
"Value",
|
||||
"Video/Audio volume",
|
||||
"Watch",
|
||||
"Watchlist",
|
||||
"Wide",
|
||||
"yellow",
|
||||
"You",
|
||||
"(You)s",
|
||||
"Zoom",
|
||||
"%s day ago",
|
||||
"%s day from now",
|
||||
"%s hour ago",
|
||||
"%s hour from now",
|
||||
"%s minute ago",
|
||||
"%s minute from now",
|
||||
"%s month ago",
|
||||
"%s month from now",
|
||||
"%s week ago",
|
||||
"%s week from now",
|
||||
"%s year ago",
|
||||
"%s year from now"]
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
# roughly extract all translation calls used in frontend scripts
|
||||
grep -ri '__' gulp/res/js/*.js \
|
||||
| sed 's/__/\n/g' \
|
||||
| awk -F'))' '{ print $1 }' \
|
||||
| grep -Po "(?<=')[^',]+(?=')" \
|
||||
| sort \
|
||||
| uniq \
|
||||
| awk '{ print "\""$0"\"""," }'
|
||||
|
||||
# | awk -F'__' '{ print $2 }' \
|
||||
Reference in New Issue
Block a user