-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #417 from zekroTJA/dev
Release 1.39.0
- Loading branch information
Showing
18 changed files
with
625 additions
and
434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!-- insert:REQUIREMENTS_FE --> | ||
- [@hcaptcha/react-hcaptcha](https://github.com/hCaptcha/react-hcaptcha#readme) `(^1.4.4)` | ||
- [byte-formatter](None) `(^1.0.1)` | ||
- [color](https://github.com/Qix-/color#readme) `(^4.2.1)` | ||
- [date-fns](https://github.com/date-fns/date-fns#readme) `(^2.28.0)` | ||
- [debounce](https://github.com/component/debounce#readme) `(^1.2.1)` | ||
- [emoji.json](https://github.com/amio/emoji.json#readme) `(^13.1.0)` | ||
- [fuse.js](http://fusejs.io) `(^6.6.2)` | ||
- [i18next](https://www.i18next.com) `(^21.6.14)` | ||
- [i18next-browser-languagedetector](https://github.com/i18next/i18next-browser-languageDetector) `(^6.1.3)` | ||
- [i18next-http-backend](https://github.com/i18next/i18next-http-backend) `(^1.4.0)` | ||
- [react](https://reactjs.org/) `(^18.2.0)` | ||
- [react-dom](https://reactjs.org/) `(^18.2.0)` | ||
- [react-fast-marquee](https://github.com/justin-chu/react-fast-marquee#readme) `(^1.3.5)` | ||
- [react-i18next](https://github.com/i18next/react-i18next) `(^11.15.7)` | ||
- [react-markdown](https://github.com/remarkjs/react-markdown#readme) `(^8.0.1)` | ||
- [react-router](https://github.com/remix-run/react-router#readme) `(^6.0.2)` | ||
- [react-router-dom](https://github.com/remix-run/react-router#readme) `(^6.2.1)` | ||
- [react-scripts](https://github.com/facebook/create-react-app#readme) `(5.0.0)` | ||
- [react-spinners](https://www.davidhu.io/react-spinners/) `(^0.13.8)` | ||
- [react-uid](https://github.com/thearnica/react-uid#readme) `(^2.3.1)` | ||
- [react-wavify](https://github.com/woofers/react-wavify#readme) `(^1.7.0)` | ||
- [sass](https://github.com/sass/dart-sass) `(^1.49.0)` | ||
- [styled-components](https://styled-components.com) `(^5.3.0)` | ||
- [web-vitals](https://github.com/GoogleChrome/web-vitals#readme) `(^2.1.2)` | ||
- [zustand](https://github.com/pmndrs/zustand) `(^3.7.0)` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
|
||
|
||
class Module: | ||
def __init__(self, line): | ||
split = line.split(' ') | ||
self.url = split[0] | ||
self.version = split[1] | ||
self.name = '/'.join(self.url.split('/')[-2:]) | ||
|
||
def string(self): | ||
return '[{}](https://{}) `({})`'.format(self.name, self.url, self.version) | ||
|
||
|
||
def main(): | ||
lines = [] | ||
with open('./go.mod') as f: | ||
lines = [l.strip() for l in f.readlines()] | ||
start = lines.index('require (') | ||
end = lines.index(')') | ||
lines = [l for l in lines[start+1:end] if not l.endswith('// indirect')] | ||
modules = [Module(l) for l in lines] | ||
|
||
with open('./docs/requirements.md', 'w') as f: | ||
f.write('<!-- insert:REQUIREMENTS -->\n') | ||
f.writelines(['- {}\n'.format(m.string()) for m in modules]) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() | ||
OUTPUT='./docs/requirements-be.md' | ||
|
||
class Module: | ||
def __init__(self, line): | ||
split = line.split(' ') | ||
self.url = split[0] | ||
self.version = split[1] | ||
self.name = '/'.join(self.url.split('/')[-2:]) | ||
|
||
def string(self): | ||
return '[{}](https://{}) `({})`'.format(self.name, self.url, self.version) | ||
|
||
|
||
def main(): | ||
lines = [] | ||
with open('./go.mod') as f: | ||
lines = [l.strip() for l in f.readlines()] | ||
start = lines.index('require (') | ||
end = lines.index(')') | ||
lines = [l for l in lines[start+1:end] if not l.endswith('// indirect')] | ||
modules = [Module(l) for l in lines] | ||
|
||
with open(OUTPUT, 'w') as f: | ||
f.write('<!-- insert:REQUIREMENTS_BE -->\n') | ||
f.writelines(['- {}\n'.format(m.string()) for m in modules]) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import json | ||
import requests | ||
|
||
|
||
OUTPUT = './docs/requirements-fe.md' | ||
|
||
|
||
def main(): | ||
data = {} | ||
with open('web/package.json') as f: | ||
data = json.load(f) | ||
|
||
modules = [] | ||
for (name, version) in data.get("dependencies").items(): | ||
print(f"Processing package {name} ...") | ||
resp = requests.get(f'https://registry.npmjs.com/{name}/latest') | ||
homepage = resp.json().get('homepage') | ||
modules.append(f"[{name}]({homepage}) `({version})`") | ||
|
||
with open(OUTPUT, 'w') as f: | ||
f.write('<!-- insert:REQUIREMENTS_FE -->\n') | ||
f.writelines([f'- {m}\n' for m in modules]) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import argparse | ||
import os | ||
from os import path | ||
import json | ||
import re | ||
|
||
|
||
WORDS_RX = r'[\w]+' | ||
|
||
|
||
def parse_args(): | ||
p = argparse.ArgumentParser() | ||
|
||
p.add_argument('dir', nargs=1, type=str, | ||
help="Language pack directory.") | ||
p.add_argument('--base', '-b', type=str, default="en-US", | ||
help="Base language code to compare against.") | ||
|
||
return p.parse_args() | ||
|
||
|
||
def main() -> int: | ||
args = parse_args() | ||
|
||
indices = {} | ||
for dir in os.listdir(args.dir[0]): | ||
indices[dir] = index_trans_pack(path.join(args.dir[0], dir)) | ||
|
||
base = indices.get(args.base) | ||
if not base: | ||
print("Error: Given base translation pack does not exist") | ||
return 1 | ||
|
||
stats = {} | ||
for (key, index) in indices.items(): | ||
files = len(index) | ||
(keys, words) = get_n_kvs(index) | ||
stats[key] = (files, keys, words) | ||
|
||
base_state = stats[args.base] | ||
for (key, stats) in [(k, s) for (k, s) in stats.items() if k != args.base]: | ||
print_state(key, base_state, stats) | ||
|
||
return 0 | ||
|
||
|
||
def index_trans_pack(dir): | ||
index = {} | ||
for (root, _, files) in os.walk(dir): | ||
for file in files: | ||
with open(path.join(root, file)) as f: | ||
index[file] = json.load(f) | ||
return index | ||
|
||
|
||
def get_n_kvs(index): | ||
n_keys = 0 | ||
n_words = 0 | ||
for (_, v) in index.items(): | ||
if type(v) == dict: | ||
(keys, words) = get_n_kvs(v) | ||
n_keys += keys | ||
n_words += words | ||
elif type(v) == list or type(v) == tuple: | ||
n_keys += len(v) | ||
n_words += sum([count_words(e) for e in v]) | ||
elif len(v) != 0: | ||
n_keys += 1 | ||
n_words += count_words(v) | ||
return (n_keys, n_words) | ||
|
||
|
||
def count_words(s): | ||
return len(re.findall(WORDS_RX, s)) | ||
|
||
|
||
def print_state(key, base, target): | ||
(b_files, b_keys, b_words) = base | ||
(t_files, t_keys, t_words) = target | ||
print( | ||
f"{key}:\n" | ||
f" files: {t_files:>5} / {b_files:>5} ({t_files/b_files:.1%})\n" | ||
f" keys: {t_keys:>5} / {b_keys:>5} ({t_keys/b_keys:.1%})\n" | ||
f" words: {t_words:>5} / {b_words:>5} ({t_words/b_words:.1%})\n" | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"discord": { | ||
"title": "Loggen Sie ich entweder über Ihren Discord Account via OAuth2 ein", | ||
"action": "Via Discord einloggen", | ||
"subline": "Wir speichern weder Ihre E-Mail-Addresse noch irgend etwas anderes und wir verifizieren nur Ihre Discord ID." | ||
"title": "Logge dich entweder mit deinem Discord-Account via OAuth2 ein ...", | ||
"action": "Mit Discord einloggen", | ||
"subline": "Wir speichern weder deine E-Mail-Addresse noch irgendetwas anderes und wir verifizieren nur deine Discord-ID." | ||
}, | ||
"alternative": { | ||
"title": "Oder schicke den folgenden Code via Direktnachricht an shinpuru", | ||
"subline": "Alternativ können Sie auch den <1>/login</1> Command benutzen." | ||
"title": "... oder schicke den folgenden Code via Direktnachricht an shinpuru.", | ||
"subline": "Alternativ kannst du auch den <1>/login</1> Befehl benutzen." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"discord": { | ||
"title": "Either log in with your Discord Account via OAuth2", | ||
"title": "Either log in with your Discord account via OAuth2 ...", | ||
"action": "Login with Discord", | ||
"subline": "We don't store your E-Mail mail address or anything else and just verify your ID." | ||
"subline": "We neither store your E-Mail address nor anything else and just verify your Discord ID." | ||
}, | ||
"alternative": { | ||
"title": "Or DM the following Code to shinpuru on Discord", | ||
"title": "... or send the following code via direct message to shinpuru.", | ||
"subline": "Alternatively, you can also use the <1>/login</1> command." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters