my17560 / dokuwiki-template-readthedokus

"Read the Docs" flavored DokuWiki template
MIT License
14 stars 11 forks source link

Make admonition title translatable #57

Closed eduardomozart closed 1 year ago

eduardomozart commented 1 year ago

Hello, When using Adminotions, it's title isn't translatable. image It's title content seems to be filled by CSS, as can be seen into the danger admonition (example):

.admonition.danger:before {
    background-color: #f29f97;
    content: "\f06a\00a0 Danger";
}

It would be great if translators could translate this for their language. I would be glad updating the PT-BR template language file to translate it if admonition title translation be available.

I also noticed that the version of the template isn't being upped at the DokuWiki website, so end users shouldn't be receiving an update notification for the template when accessing the Extension Manager. Also noticed that you're using manual changelog at the DokuWiki template page, you can also use the GitHub RSS feed to fetch the latest changes to the template instead of keeping those section manually.

my17560 commented 1 year ago

Yes, you need to overwrite styles using your custom CSS files to translate them. I know this is an ugly way, but I don't have any idea how it is possible to use the translator for those texts, yet. I'll fix it when I find the idea.

Thank you for your suggestion for using GitHub RSS feed. I'll give it a try.

eduardomozart commented 1 year ago

There’s an example on the footer of this page on DokuWiki Devel documentation to parse the meta header output to change CSS styles. Maybe you could use this hook to fetch the translated admonition title and set/change it on the fly: https://www.dokuwiki.org/devel:event:tpl_metaheader_output

my17560 commented 1 year ago

I've found the idea and updated it. New 4 words are added to the bottom of lang.php. I'm glad if you could translate PT-BR. I didn't update the template page yet, so you need to re-install the theme.

eduardomozart commented 1 year ago

Hello, I was able to apply your last commit into our Wiki instance but it didn't seem to apply the translation. I believe you applied it by creating a new tpl_extrastyles.html but it didn't seem to be commited at the template repo.

my17560 commented 1 year ago

Sorry about that. I forgot to add the file. I've added it and committed.

eduardomozart commented 1 year ago

Hello, I can confirm that with your last commit the admonitions are being translated as expected. Thank you!