OpenShot Video Editor  2.0.0
Namespaces | Variables
generate_translations.py File Reference

This file updates the OpenShot.POT (language translation template) by scanning all source files. More...

Go to the source code of this file.

Namespaces

 generate_translations
 

Variables

tuple generate_translations.blender_path = os.path.join(openshot_path, 'blender')
 
list generate_translations.category_names = []
 
string generate_translations.command = "msgcat"
 
tuple generate_translations.e = openshot.EffectInfo()
 
tuple generate_translations.effects_path = os.path.join(openshot_path, 'effects')
 
dictionary generate_translations.effects_text = {}
 
tuple generate_translations.entire_source = f.read()
 
tuple generate_translations.export_path = os.path.join(openshot_path, 'presets')
 
dictionary generate_translations.export_text = {}
 
tuple generate_translations.f = open(temp_file_path, "w")
 
tuple generate_translations.final = open(os.path.join(language_folder_path, "OpenShot.pot"), "w")
 
tuple generate_translations.full_file_path = os.path.join(effects_path, file)
 
tuple generate_translations.full_subfile_path = os.path.join(full_file_path, sub_file)
 
string generate_translations.header_text = ""
 
tuple generate_translations.language_folder_path = os.path.dirname(os.path.abspath(__file__))
 
tuple generate_translations.name = fileBaseName.replace("_", " ")
 
tuple generate_translations.name_parts = fileBaseName.split("_")
 
list generate_translations.object = props[key]
 
list generate_translations.objects
 
tuple generate_translations.openshot_path = os.path.dirname(language_folder_path)
 
tuple generate_translations.output = open(os.path.join(language_folder_path, "clean.po"), 'w')
 
tuple generate_translations.params = xmldoc.getElementsByTagName("param")
 
tuple generate_translations.path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
 
tuple generate_translations.props = json.loads(object.PropertiesJSON(1))
 
tuple generate_translations.settings = json.loads(settings_file)
 
tuple generate_translations.settings_file = open(os.path.join(info.PATH, 'settings', '_default.settings'), 'r')
 
tuple generate_translations.start_pos = entire_source.find("#: ")
 
 generate_translations.suffix_number = None
 
tuple generate_translations.temp_file_path = os.path.join(language_folder_path, temp_file_name)
 
list generate_translations.temp_files
 
tuple generate_translations.titles_path = os.path.join(openshot_path, 'titles')
 
tuple generate_translations.transitions_path = os.path.join(openshot_path, 'transitions')
 
dictionary generate_translations.transitions_text = {}
 
list generate_translations.trimmed_source = entire_source[start_pos:]
 
tuple generate_translations.windows_ui_path = os.path.join(openshot_path, 'windows', 'ui')
 
tuple generate_translations.xmldoc = xml.parse(os.path.join(effects_path, file))
 

Detailed Description

This file updates the OpenShot.POT (language translation template) by scanning all source files.

Author
Jonathan Thomas jonat.nosp@m.han@.nosp@m.opens.nosp@m.hot..nosp@m.org

This file helps you generate the POT file that contains all of the translatable strings / text in OpenShot. Because some of our text is in custom XML files, the xgettext command can't correctly generate the POT file. Thus... the existence of this file. =)

Command to create the individual language PO files (Ascii files) $ msginit –input=OpenShot.pot –locale=fr_FR $ msginit –input=OpenShot.pot –locale=es

Command to update the PO files (if text is added or changed) $ msgmerge en_US.po OpenShot.pot -U $ msgmerge es.po OpenShot.pot -U

Command to compile the Ascii PO files into binary MO files $ msgfmt en_US.po –output-file=en_US/LC_MESSAGES/OpenShot.mo $ msgfmt es.po –output-file=es/LC_MESSAGES/OpenShot.mo

Command to compile all PO files in a folder $ find -iname "*.po" -exec msgfmt {} -o {}.mo \;

Command to combine the 2 pot files into 1 file $ msgcat ~/openshot/locale/OpenShot/OpenShot_source.pot ~/openshot/openshot/locale/OpenShot/OpenShot_glade.pot -o ~/openshot/main/locale/OpenShot/OpenShot.pot

LICENSE

Copyright (c) 2008-2018 OpenShot Studios, LLC (http://www.openshotstudios.com). This file is part of OpenShot Video Editor (http://www.openshot.org), an open-source project dedicated to delivering high quality video editing and animation solutions to the world.

OpenShot Video Editor is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

OpenShot Video Editor is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with OpenShot Library. If not, see http://www.gnu.org/licenses/.

Definition in file generate_translations.py.