-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translations #21
Comments
What are you're thoughts on using https://crowdin.com/ to manage translations? Really excited this project is back btw. Happy to help contribute. |
Yep, we previously used CrowdIn and I think we'll continue to do so. |
We'll also want to make sure the frontend is translated in the dashboard too. |
For my own memory, I wrote this quick Python script to pull all strings within import re
import os
import json
def find_translation_strings(directories, file_extensions):
translation_strings = {}
regex_pattern = re.compile(r"__\('(.+?)'\)")
for directory in directories:
for root, dirs, files in os.walk(directory):
for file in files:
if any(file.endswith(ext) for ext in file_extensions):
with open(os.path.join(root, file), 'r') as f:
content = f.read()
matches = regex_pattern.findall(content)
for match in matches:
translation_strings[match] = match
sorted_translation_strings = dict(sorted(translation_strings.items()))
return json.dumps(sorted_translation_strings, indent=4)
directories = ['src', 'resources/views']
file_extensions = ['.php', '.blade.php']
translation_strings = find_translation_strings(directories, file_extensions)
print(translation_strings) |
We need to provide any static strings as a translation file.
I'm quite keen on the idea of this package only containing the English US translations, then having other packages which can be installed to provide additional languages. Are there any objections to this?
The text was updated successfully, but these errors were encountered: