This is a Python script to automatically update PO-Revision-Date
of messages.po
while translating for Bluesky app with VS code
.
-
Clone project.
-
In
VS code
you needRun on save
extension. -
Open
settings.json
to add rules like this.
"emeraldwalk.runonsave": {
"shell":"path/to/python.exe",
"commands": [
{
"match": ".po",
"cmd": "exec(open('path/to/PO-Revision-Date-Updater.py').read(), {'file_path': r'${file}', 'timezone': 'Your/Timezone'})"
}
]
}
Note
-
match
rule is regex expression. -
${file}
orr'${file}'
can be replace by absolute path. -
timezone
, For example can be likeAsia/Taipei
. -
Can be used with any case while editing .po, if
"PO-Revision-Date: \n"
presents.
- Enjoy!