Dear Ofnuts, Thanks for your reply.
In my environment, the results are a little different.
Are these useful?
GIMP 2.99.12 Python Console
Python 3.10.6 (main, Aug 12 2022, 18:00:29) [GCC 12.1.0 64 bit (AMD64)]
>>> import os
>>> os.environ['LANG']
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Program Files\GIMP 2.99\lib\python3.10\os.py", line 679, in
__getitem__
raise KeyError(key) from None
KeyError: 'LANG'
>>> os.environ['LANGUAGE']
'ja'
>>>
>>> import sys
>>> sys.platform
'win32'
>>> sys.getwindowsversion()
sys.getwindowsversion(major=10, minor=0, build=19044, platform=2,
service_pack='')
2022年8月31日(水) 22:00 Ofnuts via gimp-developer-list <
[email protected]>:
> PS: of course your Gimp should be working in Japanese (which it will be
> if these environment variables are set when you start Gimp)
>
> On 31/08/2022 14:45, Ofnuts via gimp-developer-list wrote:
> > Just re-checked, works for me. What are the environment values in the
> > Python console?
> >
> > >>> os.environ['LANG']
> > 'fr_FR.UTF-8'
> > >>> os.environ['LANGUAGE']
> > 'fr_FR'
> >
> > 'fr_FR' should be 'ja_JP' for you (and possibly only one of these is
> > necessary)
> >
> >
> > On 31/08/2022 10:58, ShiroYuki Mot wrote:
> >> Not localized!
> >> Am I doing something wrong?
> >>
> >> (I've tried replacing '_' with '-' or renaming the .mo file, but the
> >> result was the same.)
> >>
> >> cmd.exe Tree View
> >>
> >> Microsoft Windows [Version 10.0.19044.1889]
> >> (c) Microsoft Corporation. All rights reserved.
> >>
> >> C:\Users\UserA>tree C:\Users\UserA\AppData\Roaming\GIMP\2.99\plug-ins /F
> >>
> >> C:\USERS\USERA\APPDATA\ROAMING\GIMP\2.99\PLUG-INS
> >> └─Shiro_Dialog_Args6_Test_API3
> >> │ Shiro_Dialog_Args6_Test_API3.py
> >> │
> >> ├─locale
> >> │ └─ja
> >> │ └─LC_MESSAGES
> >> │ Shiro_Dialog_Args6_Test_API3.mo
> >> │
> >> └─work
> >> Shiro_Dialog_Args6_Test_API3.mo
> >> Shiro_Dialog_Args6_Test_API3.po
> >> Test.pot
> >>
> >> Notice: .pot = Shift-JIS(cp932) ANSI / .po = UTF-8 / UTF-8 (NoBOM)
> >> : OS = Windows 10 Japanese Edition
> >>
> >> Code
> >>
> >> ## GimpPlugIn virtual methods ##
> >> def do_set_i18n(self, procname):
> >> return True, 'Shiro_Dialog_Args6_Test_API3', None
> >> def do_query_procedures(self):
> >> return [ 'python-fu-shiro-dialog-args6-test-api3' ]
> >>
> >> Zipped File Shiro_Dialog_Args6_Test_API3.zip
> >>
> >> 2022年8月30日(火) 19:37 ShiroYuki Mot <[email protected]>:
> >>
> >> Dear Ofnuts.
> >>
> >> Thanks for presenting the solution.
> >> It was detailed and easy to understand.
> >> I'm glad that this clears up my questions. :)
> >> I'll try this tonight.
> >>
> >> 2022年8月30日(火) 18:40 Ofnuts via gimp-developer-list
> >> <[email protected]>:
> >>
> >> My own plugin does:
> >>
> >> def do_set_i18n(self, *args):
> >> print(f'do_set_i18n({args})')
> >> return True, 'ofn-guides-presets',None
> >>
> >> (where 'ofn-guides-presets' is the same same as the plugin
> >> python file
> >> itself, and as I understand it, if the I18N domain is the same
> >> name as the plugin file, you don't even need to define this
> >> method,
> >> because it's the default behavior.
> >>
> >> Then you create the .mo file(s) and put them in a
> >> locale/{language
> >> code}/LC_MESSAGES subdirectory of your plugin directory.
> >> ofn-guides-presets/
> >> ├── locale
> >> │ └── fr
> >> │ └── LC_MESSAGES
> >> │ └── ofn-guides-presets.mo # messages for French
> >> └── ofn-guides-presets.py # plugin code
> >>
> >> And yes, using 'gimp30-python' in your own scripts doesn't
> >> make much
> >> sense (it does for scripts delivered with Gimp, that share the
> >> message
> >> base with other code).
> >>
> >>
> >> On 29/08/2022 10:20, ShiroYuki Mot via gimp-developer-list
> >> wrote:
> >> > In the official page at
> >> > https://www.gimp.org/news/2022/08/27/gimp-2-99-12-released/,
> >> > You say that "with all gettext catalogs under the locale/
> >> folder of the
> >> > plug-in directory, and named the same way as the plug-in
> >> itself".
> >> >
> >> > Please teach me 'How TO do that'.
> >> >
> >> > On OS, Windows, If I placed my script file
> >> > (Shiro_Dialog_Args6_Test_API3.py) at
> >> >
> >>
> C:\Users\UserA\AppData\Roaming\GIMP\2.99\plug-ins\Shiro_Dialog_Args6_Test_API3,
> >> > Where do I deploy .mo file?
> >> > Is it at
> >> >
> >>
> 'C:\Users\UserA\AppData\Roaming\GIMP\2.99\plug-ins\Shiro_Dialog_Args6_Test_API3\locale'?
> >> > Or at
> >> 'C:\Users\UserA\AppData\Roaming\GIMP\2.99\plug-ins\locale'?
> >> > And one more question.
> >> > How do I write the following parts?
> >> > def do_set_i18n(self, procname):
> >> > return True, 'gimp30-python', None
> >> > (Maybe, That code means calling the official
> >> gimp30-python.mo.)
> >> > _______________________________________________
> >> > gimp-developer-list mailing list
> >> > List address:[email protected]
> >> <mailto:address%[email protected]>
> >> > List
> >> membership:https://mail.gnome.org/mailman/listinfo/gimp-developer-list
> >> > List
> >> archives:https://mail.gnome.org/archives/gimp-developer-list
> >>
> >> _______________________________________________
> >> gimp-developer-list mailing list
> >> List address: [email protected]
> >> List membership:
> >> https://mail.gnome.org/mailman/listinfo/gimp-developer-list
> >> List archives:
> >> https://mail.gnome.org/archives/gimp-developer-list
> >>
> > _______________________________________________
> > gimp-developer-list mailing list
> > List address: [email protected]
> > List membership:
> > https://mail.gnome.org/mailman/listinfo/gimp-developer-list
> > List archives: https://mail.gnome.org/archives/gimp-developer-list
>
> _______________________________________________
> gimp-developer-list mailing list
> List address: [email protected]
> List membership:
> https://mail.gnome.org/mailman/listinfo/gimp-developer-list
> List archives: https://mail.gnome.org/archives/gimp-developer-list
>
_______________________________________________
gimp-developer-list mailing list
List address: [email protected]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives: https://mail.gnome.org/archives/gimp-developer-list