-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added python scripts for calling the python scripts from the mac-mouse-fix repo. (The mmf repo is expected to be at ./../mac-mouse-fix). - Now calling new preprocess.py script before compiling, which calls python script inside the mac-mouse-fix repo which compiles ./locales/Localizble.xcstrings file to ./locales/Localizable.js file. - Localizable.js is now where nuxt loads translated strings from. - Also some improves docs and minor stuff. - This stuff still needs a bit of work but I need a break. TODO: - Make quote-strings display properly in their sourceLanguage (mostly English) - Load language name and flag using python script instead of hardcoding - Show full list of languages in the language picker (even if they are 0% localized) - Show a 'translation progress' message at the top if a language is not 100% localized. (Similar to what we do for markdown files) After that: - Make the upload-strings script upload the website strings as well. (We'll probably have to hack the .pbxproject file to make that smooth, but in a simple way) - (PERHAPS) Implement a sync-strings script for syncing the mmf-website source files with the Localizble.xcstrings file. (This is probably not that necessary.)
- Loading branch information
1 parent
a3c7519
commit bf50705
Showing
8 changed files
with
405 additions
and
11 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
Large diffs are not rendered by default.
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
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,25 @@ | ||
""" | ||
This script is run before compiling the project. | ||
Note: | ||
- We used to have this be in javascript (.mjs) but that didn't print the prints of the scripts it invoked? I'm just more familiar with python. | ||
""" | ||
|
||
|
||
import subprocess | ||
|
||
def main(): | ||
|
||
# Compile .xcstrings to .js | ||
print("Calling mmf-website-compile-strings script ...") | ||
subprocess.run('python3 ./scripts/run.py mmf-website-compile-strings --output_path locales/Localizable.js', text=True, shell=True) | ||
|
||
# Move licenseinfo to ./public folder | ||
print("Calling copy-licenseinfo script ...") | ||
subprocess.run('node ./scripts/copy-licenseinfo.cjs', text=True, shell=True) | ||
|
||
|
||
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,47 @@ | ||
|
||
""" | ||
This script lets us use the python scripts that are in the mac-mouse-fix repo. | ||
(The mac-mouse-fix repo is expected to be at ./../mac-mouse-fix/ relative to this repo.) | ||
This lets us tap into all the nice python utility functions which we already wrote inside the mac-mouse-fix repo. | ||
We might also write .py scripts specifically for this website, but still put them into the mac-mouse-fix repo. | ||
""" | ||
|
||
# | ||
# Imports | ||
# | ||
|
||
# Note: Only import stdlib stuff (not pip packages) to keep this script portable and dependency-free. | ||
|
||
import subprocess | ||
import os | ||
import sys | ||
|
||
# | ||
# Constants | ||
# | ||
|
||
mmf_repo_path = '../mac-mouse-fix/' | ||
mmf_repo_run_subpath = './Scripts/run.py' | ||
mmf_to_website_repo_path = '../mac-mouse-fix-website/' | ||
|
||
# | ||
# main | ||
# | ||
def main(): | ||
|
||
# Prepare args | ||
args = sys.argv[1:] | ||
args += ['--target_repo', mmf_to_website_repo_path] | ||
|
||
# Change workding dir | ||
os.chdir(mmf_repo_path) | ||
|
||
# Call run.py | ||
subprocess.run(['python3', mmf_repo_run_subpath, *args]) # Idk whether to use subprocess.run or .check_call, or something else, and whether to handle the return here | ||
|
||
# | ||
# Call main | ||
# | ||
if __name__ == '__main__': | ||
main() |