Last active
August 29, 2015 14:19
-
-
Save nutti/0f6ac9b86a2667c4f899 to your computer and use it in GitHub Desktop.
Translation in Blender add-on
This file contains hidden or 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
import bpy | |
translation_dict = { | |
"ja_JP": {("*", "key1"):"hoge"}, | |
"en_US": {("*", "key1"):"test"}} | |
class TranslationTestClass(bpy.types.Operator): | |
bl_idname = "uv.translation_test" | |
def execute(self, context): | |
self.report({'INFO'}, bpy.app.translations.pgettext("key1")) | |
return {'FINISHED'} | |
def register(): | |
bpy.utils.register_module(__name__) | |
bpy.app.translations.register(__name__, translation_dict) | |
def unregister(): | |
bpy.utils.unregister_module(__name__) | |
if __name__ == "__main__": | |
register() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment