Skip to content

Commit b2b4b45

Browse files
committed
1 parent c0de701 commit b2b4b45

7 files changed

Lines changed: 84 additions & 84 deletions

File tree

chatgpt/amazongpt/utils/translate-en-messages.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'''
22
Name: translate-en-messages.py
3-
Version: 2026.2.10.23
3+
Version: 2026.2.10.25
44
Author: Adam Lui
55
Description: Translate en/messages.json to other locales
66
Homepage: https://github.com/adamlui/python-utils
@@ -17,18 +17,18 @@
1717

1818
cli = sns(
1919
name='translate-messages',
20-
urls=sns(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils')
20+
urls=sns(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils'),
21+
default_target_locales=[
22+
'af', 'am', 'ar', 'az', 'be', 'bem', 'bg', 'bn', 'bo', 'bs', 'ca', 'ceb', 'cs', 'cy', 'da', 'de', 'dv', 'dz',
23+
'el', 'en', 'en-GB', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fo', 'fr', 'gd', 'gl', 'gu', 'haw', 'he', 'hi', 'hr',
24+
'ht', 'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kab', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'la', 'lb', 'lo',
25+
'lt', 'lv', 'mg', 'mi', 'mk', 'ml', 'mn', 'ms', 'mt', 'my', 'ne', 'nl', 'no', 'ny', 'pa', 'pap', 'pl', 'ps',
26+
'pt', 'ro', 'ru', 'rw', 'sg', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'sv', 'sw', 'ta', 'te', 'tg', 'th',
27+
'ti', 'tk', 'tn', 'tpi', 'tr', 'uk', 'ur', 'uz', 'vi', 'xh', 'yi', 'zh', 'zh-CN', 'zh-HK', 'zh-SG', 'zh-TW',
28+
'zu'
29+
]
2130
)
2231

23-
default_target_locales = [
24-
'af', 'am', 'ar', 'az', 'be', 'bem', 'bg', 'bn', 'bo', 'bs', 'ca', 'ceb', 'cs', 'cy', 'da', 'de', 'dv', 'dz', 'el',
25-
'en', 'en-GB', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fo', 'fr', 'gd', 'gl', 'gu', 'haw', 'he', 'hi', 'hr', 'ht',
26-
'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kab', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'la', 'lb', 'lo', 'lt', 'lv',
27-
'mg', 'mi', 'mk', 'ml', 'mn', 'ms', 'mt', 'my', 'ne', 'nl', 'no', 'ny', 'pa', 'pap', 'pl', 'ps', 'pt', 'ro', 'ru',
28-
'rw', 'sg', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'sv', 'sw', 'ta', 'te', 'tg', 'th', 'ti', 'tk', 'tn', 'tpi',
29-
'tr', 'uk', 'ur', 'uz', 'vi', 'xh', 'yi', 'zh', 'zh-CN', 'zh-HK', 'zh-SG', 'zh-TW', 'zu'
30-
]
31-
3232
# Init/load config file
3333
cli.script_name = os.path.splitext(os.path.basename(__file__))[0]
3434
cli.config_filename = f'{cli.script_name}.config.json'
@@ -68,7 +68,7 @@
6868
def parse_csv_langs(str) : return [lang.strip() for lang in str.split(',') if lang.strip()]
6969
include_arg = args.include_langs or cli.config_data.get('include_langs', '')
7070
exclude_arg = args.exclude_langs or cli.config_data.get('exclude_langs', '')
71-
target_locales = parse_csv_langs(include_arg) or default_target_locales
71+
target_locales = parse_csv_langs(include_arg) or cli.default_target_locales
7272
exclude_langs = set(parse_csv_langs(exclude_arg))
7373
target_locales = [lang for lang in target_locales if lang not in exclude_langs]
7474

chatgpt/autoclear-chatgpt-history/utils/translate-en-messages.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'''
22
Name: translate-en-messages.py
3-
Version: 2026.2.10.23
3+
Version: 2026.2.10.25
44
Author: Adam Lui
55
Description: Translate en/messages.json to other locales
66
Homepage: https://github.com/adamlui/python-utils
@@ -17,18 +17,18 @@
1717

1818
cli = sns(
1919
name='translate-messages',
20-
urls=sns(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils')
20+
urls=sns(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils'),
21+
default_target_locales=[
22+
'af', 'am', 'ar', 'az', 'be', 'bem', 'bg', 'bn', 'bo', 'bs', 'ca', 'ceb', 'cs', 'cy', 'da', 'de', 'dv', 'dz',
23+
'el', 'en', 'en-GB', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fo', 'fr', 'gd', 'gl', 'gu', 'haw', 'he', 'hi', 'hr',
24+
'ht', 'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kab', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'la', 'lb', 'lo',
25+
'lt', 'lv', 'mg', 'mi', 'mk', 'ml', 'mn', 'ms', 'mt', 'my', 'ne', 'nl', 'no', 'ny', 'pa', 'pap', 'pl', 'ps',
26+
'pt', 'ro', 'ru', 'rw', 'sg', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'sv', 'sw', 'ta', 'te', 'tg', 'th',
27+
'ti', 'tk', 'tn', 'tpi', 'tr', 'uk', 'ur', 'uz', 'vi', 'xh', 'yi', 'zh', 'zh-CN', 'zh-HK', 'zh-SG', 'zh-TW',
28+
'zu'
29+
]
2130
)
2231

23-
default_target_locales = [
24-
'af', 'am', 'ar', 'az', 'be', 'bem', 'bg', 'bn', 'bo', 'bs', 'ca', 'ceb', 'cs', 'cy', 'da', 'de', 'dv', 'dz', 'el',
25-
'en', 'en-GB', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fo', 'fr', 'gd', 'gl', 'gu', 'haw', 'he', 'hi', 'hr', 'ht',
26-
'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kab', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'la', 'lb', 'lo', 'lt', 'lv',
27-
'mg', 'mi', 'mk', 'ml', 'mn', 'ms', 'mt', 'my', 'ne', 'nl', 'no', 'ny', 'pa', 'pap', 'pl', 'ps', 'pt', 'ro', 'ru',
28-
'rw', 'sg', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'sv', 'sw', 'ta', 'te', 'tg', 'th', 'ti', 'tk', 'tn', 'tpi',
29-
'tr', 'uk', 'ur', 'uz', 'vi', 'xh', 'yi', 'zh', 'zh-CN', 'zh-HK', 'zh-SG', 'zh-TW', 'zu'
30-
]
31-
3232
# Init/load config file
3333
cli.script_name = os.path.splitext(os.path.basename(__file__))[0]
3434
cli.config_filename = f'{cli.script_name}.config.json'
@@ -68,7 +68,7 @@
6868
def parse_csv_langs(str) : return [lang.strip() for lang in str.split(',') if lang.strip()]
6969
include_arg = args.include_langs or cli.config_data.get('include_langs', '')
7070
exclude_arg = args.exclude_langs or cli.config_data.get('exclude_langs', '')
71-
target_locales = parse_csv_langs(include_arg) or default_target_locales
71+
target_locales = parse_csv_langs(include_arg) or cli.default_target_locales
7272
exclude_langs = set(parse_csv_langs(exclude_arg))
7373
target_locales = [lang for lang in target_locales if lang not in exclude_langs]
7474

chatgpt/bravegpt/utils/translate-en-messages.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'''
22
Name: translate-en-messages.py
3-
Version: 2026.2.10.23
3+
Version: 2026.2.10.25
44
Author: Adam Lui
55
Description: Translate en/messages.json to other locales
66
Homepage: https://github.com/adamlui/python-utils
@@ -17,18 +17,18 @@
1717

1818
cli = sns(
1919
name='translate-messages',
20-
urls=sns(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils')
20+
urls=sns(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils'),
21+
default_target_locales=[
22+
'af', 'am', 'ar', 'az', 'be', 'bem', 'bg', 'bn', 'bo', 'bs', 'ca', 'ceb', 'cs', 'cy', 'da', 'de', 'dv', 'dz',
23+
'el', 'en', 'en-GB', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fo', 'fr', 'gd', 'gl', 'gu', 'haw', 'he', 'hi', 'hr',
24+
'ht', 'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kab', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'la', 'lb', 'lo',
25+
'lt', 'lv', 'mg', 'mi', 'mk', 'ml', 'mn', 'ms', 'mt', 'my', 'ne', 'nl', 'no', 'ny', 'pa', 'pap', 'pl', 'ps',
26+
'pt', 'ro', 'ru', 'rw', 'sg', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'sv', 'sw', 'ta', 'te', 'tg', 'th',
27+
'ti', 'tk', 'tn', 'tpi', 'tr', 'uk', 'ur', 'uz', 'vi', 'xh', 'yi', 'zh', 'zh-CN', 'zh-HK', 'zh-SG', 'zh-TW',
28+
'zu'
29+
]
2130
)
2231

23-
default_target_locales = [
24-
'af', 'am', 'ar', 'az', 'be', 'bem', 'bg', 'bn', 'bo', 'bs', 'ca', 'ceb', 'cs', 'cy', 'da', 'de', 'dv', 'dz', 'el',
25-
'en', 'en-GB', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fo', 'fr', 'gd', 'gl', 'gu', 'haw', 'he', 'hi', 'hr', 'ht',
26-
'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kab', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'la', 'lb', 'lo', 'lt', 'lv',
27-
'mg', 'mi', 'mk', 'ml', 'mn', 'ms', 'mt', 'my', 'ne', 'nl', 'no', 'ny', 'pa', 'pap', 'pl', 'ps', 'pt', 'ro', 'ru',
28-
'rw', 'sg', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'sv', 'sw', 'ta', 'te', 'tg', 'th', 'ti', 'tk', 'tn', 'tpi',
29-
'tr', 'uk', 'ur', 'uz', 'vi', 'xh', 'yi', 'zh', 'zh-CN', 'zh-HK', 'zh-SG', 'zh-TW', 'zu'
30-
]
31-
3232
# Init/load config file
3333
cli.script_name = os.path.splitext(os.path.basename(__file__))[0]
3434
cli.config_filename = f'{cli.script_name}.config.json'
@@ -68,7 +68,7 @@
6868
def parse_csv_langs(str) : return [lang.strip() for lang in str.split(',') if lang.strip()]
6969
include_arg = args.include_langs or cli.config_data.get('include_langs', '')
7070
exclude_arg = args.exclude_langs or cli.config_data.get('exclude_langs', '')
71-
target_locales = parse_csv_langs(include_arg) or default_target_locales
71+
target_locales = parse_csv_langs(include_arg) or cli.default_target_locales
7272
exclude_langs = set(parse_csv_langs(exclude_arg))
7373
target_locales = [lang for lang in target_locales if lang not in exclude_langs]
7474

chatgpt/chatgpt-auto-refresh/utils/translate-en-messages.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'''
22
Name: translate-en-messages.py
3-
Version: 2026.2.10.23
3+
Version: 2026.2.10.25
44
Author: Adam Lui
55
Description: Translate en/messages.json to other locales
66
Homepage: https://github.com/adamlui/python-utils
@@ -17,18 +17,18 @@
1717

1818
cli = sns(
1919
name='translate-messages',
20-
urls=sns(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils')
20+
urls=sns(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils'),
21+
default_target_locales=[
22+
'af', 'am', 'ar', 'az', 'be', 'bem', 'bg', 'bn', 'bo', 'bs', 'ca', 'ceb', 'cs', 'cy', 'da', 'de', 'dv', 'dz',
23+
'el', 'en', 'en-GB', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fo', 'fr', 'gd', 'gl', 'gu', 'haw', 'he', 'hi', 'hr',
24+
'ht', 'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kab', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'la', 'lb', 'lo',
25+
'lt', 'lv', 'mg', 'mi', 'mk', 'ml', 'mn', 'ms', 'mt', 'my', 'ne', 'nl', 'no', 'ny', 'pa', 'pap', 'pl', 'ps',
26+
'pt', 'ro', 'ru', 'rw', 'sg', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'sv', 'sw', 'ta', 'te', 'tg', 'th',
27+
'ti', 'tk', 'tn', 'tpi', 'tr', 'uk', 'ur', 'uz', 'vi', 'xh', 'yi', 'zh', 'zh-CN', 'zh-HK', 'zh-SG', 'zh-TW',
28+
'zu'
29+
]
2130
)
2231

23-
default_target_locales = [
24-
'af', 'am', 'ar', 'az', 'be', 'bem', 'bg', 'bn', 'bo', 'bs', 'ca', 'ceb', 'cs', 'cy', 'da', 'de', 'dv', 'dz', 'el',
25-
'en', 'en-GB', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fo', 'fr', 'gd', 'gl', 'gu', 'haw', 'he', 'hi', 'hr', 'ht',
26-
'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kab', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'la', 'lb', 'lo', 'lt', 'lv',
27-
'mg', 'mi', 'mk', 'ml', 'mn', 'ms', 'mt', 'my', 'ne', 'nl', 'no', 'ny', 'pa', 'pap', 'pl', 'ps', 'pt', 'ro', 'ru',
28-
'rw', 'sg', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'sv', 'sw', 'ta', 'te', 'tg', 'th', 'ti', 'tk', 'tn', 'tpi',
29-
'tr', 'uk', 'ur', 'uz', 'vi', 'xh', 'yi', 'zh', 'zh-CN', 'zh-HK', 'zh-SG', 'zh-TW', 'zu'
30-
]
31-
3232
# Init/load config file
3333
cli.script_name = os.path.splitext(os.path.basename(__file__))[0]
3434
cli.config_filename = f'{cli.script_name}.config.json'
@@ -68,7 +68,7 @@
6868
def parse_csv_langs(str) : return [lang.strip() for lang in str.split(',') if lang.strip()]
6969
include_arg = args.include_langs or cli.config_data.get('include_langs', '')
7070
exclude_arg = args.exclude_langs or cli.config_data.get('exclude_langs', '')
71-
target_locales = parse_csv_langs(include_arg) or default_target_locales
71+
target_locales = parse_csv_langs(include_arg) or cli.default_target_locales
7272
exclude_langs = set(parse_csv_langs(exclude_arg))
7373
target_locales = [lang for lang in target_locales if lang not in exclude_langs]
7474

chatgpt/chatgpt-auto-talk/utils/translate-en-messages.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'''
22
Name: translate-en-messages.py
3-
Version: 2026.2.10.23
3+
Version: 2026.2.10.25
44
Author: Adam Lui
55
Description: Translate en/messages.json to other locales
66
Homepage: https://github.com/adamlui/python-utils
@@ -17,18 +17,18 @@
1717

1818
cli = sns(
1919
name='translate-messages',
20-
urls=sns(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils')
20+
urls=sns(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils'),
21+
default_target_locales=[
22+
'af', 'am', 'ar', 'az', 'be', 'bem', 'bg', 'bn', 'bo', 'bs', 'ca', 'ceb', 'cs', 'cy', 'da', 'de', 'dv', 'dz',
23+
'el', 'en', 'en-GB', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fo', 'fr', 'gd', 'gl', 'gu', 'haw', 'he', 'hi', 'hr',
24+
'ht', 'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kab', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'la', 'lb', 'lo',
25+
'lt', 'lv', 'mg', 'mi', 'mk', 'ml', 'mn', 'ms', 'mt', 'my', 'ne', 'nl', 'no', 'ny', 'pa', 'pap', 'pl', 'ps',
26+
'pt', 'ro', 'ru', 'rw', 'sg', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'sv', 'sw', 'ta', 'te', 'tg', 'th',
27+
'ti', 'tk', 'tn', 'tpi', 'tr', 'uk', 'ur', 'uz', 'vi', 'xh', 'yi', 'zh', 'zh-CN', 'zh-HK', 'zh-SG', 'zh-TW',
28+
'zu'
29+
]
2130
)
2231

23-
default_target_locales = [
24-
'af', 'am', 'ar', 'az', 'be', 'bem', 'bg', 'bn', 'bo', 'bs', 'ca', 'ceb', 'cs', 'cy', 'da', 'de', 'dv', 'dz', 'el',
25-
'en', 'en-GB', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fo', 'fr', 'gd', 'gl', 'gu', 'haw', 'he', 'hi', 'hr', 'ht',
26-
'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kab', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'la', 'lb', 'lo', 'lt', 'lv',
27-
'mg', 'mi', 'mk', 'ml', 'mn', 'ms', 'mt', 'my', 'ne', 'nl', 'no', 'ny', 'pa', 'pap', 'pl', 'ps', 'pt', 'ro', 'ru',
28-
'rw', 'sg', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'sv', 'sw', 'ta', 'te', 'tg', 'th', 'ti', 'tk', 'tn', 'tpi',
29-
'tr', 'uk', 'ur', 'uz', 'vi', 'xh', 'yi', 'zh', 'zh-CN', 'zh-HK', 'zh-SG', 'zh-TW', 'zu'
30-
]
31-
3232
# Init/load config file
3333
cli.script_name = os.path.splitext(os.path.basename(__file__))[0]
3434
cli.config_filename = f'{cli.script_name}.config.json'
@@ -68,7 +68,7 @@
6868
def parse_csv_langs(str) : return [lang.strip() for lang in str.split(',') if lang.strip()]
6969
include_arg = args.include_langs or cli.config_data.get('include_langs', '')
7070
exclude_arg = args.exclude_langs or cli.config_data.get('exclude_langs', '')
71-
target_locales = parse_csv_langs(include_arg) or default_target_locales
71+
target_locales = parse_csv_langs(include_arg) or cli.default_target_locales
7272
exclude_langs = set(parse_csv_langs(exclude_arg))
7373
target_locales = [lang for lang in target_locales if lang not in exclude_langs]
7474

chatgpt/duckduckgpt/utils/translate-en-messages.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'''
22
Name: translate-en-messages.py
3-
Version: 2026.2.10.23
3+
Version: 2026.2.10.25
44
Author: Adam Lui
55
Description: Translate en/messages.json to other locales
66
Homepage: https://github.com/adamlui/python-utils
@@ -17,18 +17,18 @@
1717

1818
cli = sns(
1919
name='translate-messages',
20-
urls=sns(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils')
20+
urls=sns(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils'),
21+
default_target_locales=[
22+
'af', 'am', 'ar', 'az', 'be', 'bem', 'bg', 'bn', 'bo', 'bs', 'ca', 'ceb', 'cs', 'cy', 'da', 'de', 'dv', 'dz',
23+
'el', 'en', 'en-GB', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fo', 'fr', 'gd', 'gl', 'gu', 'haw', 'he', 'hi', 'hr',
24+
'ht', 'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kab', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'la', 'lb', 'lo',
25+
'lt', 'lv', 'mg', 'mi', 'mk', 'ml', 'mn', 'ms', 'mt', 'my', 'ne', 'nl', 'no', 'ny', 'pa', 'pap', 'pl', 'ps',
26+
'pt', 'ro', 'ru', 'rw', 'sg', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'sv', 'sw', 'ta', 'te', 'tg', 'th',
27+
'ti', 'tk', 'tn', 'tpi', 'tr', 'uk', 'ur', 'uz', 'vi', 'xh', 'yi', 'zh', 'zh-CN', 'zh-HK', 'zh-SG', 'zh-TW',
28+
'zu'
29+
]
2130
)
2231

23-
default_target_locales = [
24-
'af', 'am', 'ar', 'az', 'be', 'bem', 'bg', 'bn', 'bo', 'bs', 'ca', 'ceb', 'cs', 'cy', 'da', 'de', 'dv', 'dz', 'el',
25-
'en', 'en-GB', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fo', 'fr', 'gd', 'gl', 'gu', 'haw', 'he', 'hi', 'hr', 'ht',
26-
'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kab', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'la', 'lb', 'lo', 'lt', 'lv',
27-
'mg', 'mi', 'mk', 'ml', 'mn', 'ms', 'mt', 'my', 'ne', 'nl', 'no', 'ny', 'pa', 'pap', 'pl', 'ps', 'pt', 'ro', 'ru',
28-
'rw', 'sg', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'sv', 'sw', 'ta', 'te', 'tg', 'th', 'ti', 'tk', 'tn', 'tpi',
29-
'tr', 'uk', 'ur', 'uz', 'vi', 'xh', 'yi', 'zh', 'zh-CN', 'zh-HK', 'zh-SG', 'zh-TW', 'zu'
30-
]
31-
3232
# Init/load config file
3333
cli.script_name = os.path.splitext(os.path.basename(__file__))[0]
3434
cli.config_filename = f'{cli.script_name}.config.json'
@@ -68,7 +68,7 @@
6868
def parse_csv_langs(str) : return [lang.strip() for lang in str.split(',') if lang.strip()]
6969
include_arg = args.include_langs or cli.config_data.get('include_langs', '')
7070
exclude_arg = args.exclude_langs or cli.config_data.get('exclude_langs', '')
71-
target_locales = parse_csv_langs(include_arg) or default_target_locales
71+
target_locales = parse_csv_langs(include_arg) or cli.default_target_locales
7272
exclude_langs = set(parse_csv_langs(exclude_arg))
7373
target_locales = [lang for lang in target_locales if lang not in exclude_langs]
7474

chatgpt/googlegpt/utils/translate-en-messages.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'''
22
Name: translate-en-messages.py
3-
Version: 2026.2.10.23
3+
Version: 2026.2.10.25
44
Author: Adam Lui
55
Description: Translate en/messages.json to other locales
66
Homepage: https://github.com/adamlui/python-utils
@@ -17,18 +17,18 @@
1717

1818
cli = sns(
1919
name='translate-messages',
20-
urls=sns(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils')
20+
urls=sns(jsdelivr='https://cdn.jsdelivr.net/gh/adamlui/python-utils'),
21+
default_target_locales=[
22+
'af', 'am', 'ar', 'az', 'be', 'bem', 'bg', 'bn', 'bo', 'bs', 'ca', 'ceb', 'cs', 'cy', 'da', 'de', 'dv', 'dz',
23+
'el', 'en', 'en-GB', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fo', 'fr', 'gd', 'gl', 'gu', 'haw', 'he', 'hi', 'hr',
24+
'ht', 'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kab', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'la', 'lb', 'lo',
25+
'lt', 'lv', 'mg', 'mi', 'mk', 'ml', 'mn', 'ms', 'mt', 'my', 'ne', 'nl', 'no', 'ny', 'pa', 'pap', 'pl', 'ps',
26+
'pt', 'ro', 'ru', 'rw', 'sg', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'sv', 'sw', 'ta', 'te', 'tg', 'th',
27+
'ti', 'tk', 'tn', 'tpi', 'tr', 'uk', 'ur', 'uz', 'vi', 'xh', 'yi', 'zh', 'zh-CN', 'zh-HK', 'zh-SG', 'zh-TW',
28+
'zu'
29+
]
2130
)
2231

23-
default_target_locales = [
24-
'af', 'am', 'ar', 'az', 'be', 'bem', 'bg', 'bn', 'bo', 'bs', 'ca', 'ceb', 'cs', 'cy', 'da', 'de', 'dv', 'dz', 'el',
25-
'en', 'en-GB', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fo', 'fr', 'gd', 'gl', 'gu', 'haw', 'he', 'hi', 'hr', 'ht',
26-
'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kab', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'la', 'lb', 'lo', 'lt', 'lv',
27-
'mg', 'mi', 'mk', 'ml', 'mn', 'ms', 'mt', 'my', 'ne', 'nl', 'no', 'ny', 'pa', 'pap', 'pl', 'ps', 'pt', 'ro', 'ru',
28-
'rw', 'sg', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'sv', 'sw', 'ta', 'te', 'tg', 'th', 'ti', 'tk', 'tn', 'tpi',
29-
'tr', 'uk', 'ur', 'uz', 'vi', 'xh', 'yi', 'zh', 'zh-CN', 'zh-HK', 'zh-SG', 'zh-TW', 'zu'
30-
]
31-
3232
# Init/load config file
3333
cli.script_name = os.path.splitext(os.path.basename(__file__))[0]
3434
cli.config_filename = f'{cli.script_name}.config.json'
@@ -68,7 +68,7 @@
6868
def parse_csv_langs(str) : return [lang.strip() for lang in str.split(',') if lang.strip()]
6969
include_arg = args.include_langs or cli.config_data.get('include_langs', '')
7070
exclude_arg = args.exclude_langs or cli.config_data.get('exclude_langs', '')
71-
target_locales = parse_csv_langs(include_arg) or default_target_locales
71+
target_locales = parse_csv_langs(include_arg) or cli.default_target_locales
7272
exclude_langs = set(parse_csv_langs(exclude_arg))
7373
target_locales = [lang for lang in target_locales if lang not in exclude_langs]
7474

0 commit comments

Comments
 (0)