diff options
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/modules/bl_i18n_utils/utils_cli.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/utils_cli.py b/release/scripts/modules/bl_i18n_utils/utils_cli.py index 4390544ec17..d38911c122d 100644 --- a/release/scripts/modules/bl_i18n_utils/utils_cli.py +++ b/release/scripts/modules/bl_i18n_utils/utils_cli.py @@ -62,6 +62,15 @@ def strip_po(args, settings): po.write(kind="PO_COMPACT", dest=args.dst) +def rtl_process_po(args, settings): + uid = os.path.splitext(os.path.basename(args.src))[0] + if not args.dst: + args.dst = args.src + po = utils_i18n.I18nMessages(uid=uid, kind='PO', src=args.src, settings=settings) + po.rtl_process() + po.write(kind="PO", dest=args.dst) + + def language_menu(args, settings): # 'DEFAULT' and en_US are always valid, fully-translated "languages"! stats = {"DEFAULT": 1.0, "en_US": 1.0} @@ -111,6 +120,12 @@ def main(): sub_parser.add_argument('--dst', metavar='dst.po', help="The destination po to write to.") sub_parser.set_defaults(func=strip_po) + sub_parser = sub_parsers.add_parser('rtl_process_po', + help="Pre-process PO files for RTL languages.") + sub_parser.add_argument('--src', metavar='src.po', required=True, help="The source po file to process.") + sub_parser.add_argument('--dst', metavar='dst.po', help="The destination po to write to.") + sub_parser.set_defaults(func=rtl_process_po) + sub_parser = sub_parsers.add_parser('language_menu', help="Generate the text file used by Blender to create its language menu.") sub_parser.set_defaults(func=language_menu) |