Hi,

Sorry for confusing. The comment is not good. You need to give the
filename of .po file into add_message_catalog() and get_translation().
If you're using __name__ into them, You need to rename your .po file
to "sphinxcontrib.secualert.po". Because __name__ equals its package
name.

Thanks,
Takeshi KOMIYA

2019年1月22日(火) 22:28 Vincent Férotin <[email protected]>:
>
> Hi, Sphinx users!
>
> Did some of you succeeded in internationalizing and localizing a Sphinx 
> extension?
> My first naïve attempt failed, i.e. extension seems to work as expected,
> but translation did not occurred.
>
> I've put its sources in GitHub repository: 
> https://github.com/vincent-ferotin/sphinxcontrib-secualert
> so all could review and point what's missing and/or wrong...
>
> The extension is essentially copied from sphinx.ext.todo.
> It introduces 2 new directives:
> ``.. secualert::``, related to a security alert item,
> and ``.. secualertlist::``, for listing all previously described alerts.
>
> Messages translations stand in /sphinxcontrib/secualert/locale directory.
> I followed 
> http://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_message_catalog
> and 
> http://www.sphinx-doc.org/en/master/extdev/i18n.html#sphinx.locale.get_translation
> to setup extension with its own translated catalogs.
> Also, I'd taken care of including *.po and *.mo in package setup.
>
> But I probably missed something, as shown in project example (/example/ dir.),
> where translation failed for 'fr' (our 'fr_FR') language...
> Does anybody could help fixing this, please?
>
> (I quickly review all extensions in 
> https://bitbucket.org/birkenfeld/sphinx-contrib
> but none seems to be localized.)
>
> Thanks in advance,
>
> V.F.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sphinx-users.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to