2 Star 3 Fork 1

jeady / Stirling-PDF

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
HowToAddNewLanguage.md 1.73 KB
一键复制 编辑 原始数据 按行查看 历史


Stirling-PDF

How to add new languages to Stirling-PDF

Fork Stirling-PDF and make a new branch out of Main

Then add reference to the language in the navbar by adding a new language entry to the dropdown

https://github.com/Stirling-Tools/Stirling-PDF/blob/main/src/main/resources/templates/fragments/languages.html and add a flag svg file to https://github.com/Stirling-Tools/Stirling-PDF/tree/main/src/main/resources/static/images/flags Any SVG flags are fine, i got most of mine from here If your language isnt represented by a flag just find whichever closely matches it, such as for Arabic i chose Saudi Arabia

For example to add Polish you would add

<a class="dropdown-item lang_dropdown-item" href="" data-language-code="pl_PL">
    <img src="images/flags/pl.svg" alt="icon" width="20" height="15"> Polski
</a>

The data-language-code is the code used to reference the file in the next step.

Start by copying the existing english property file

https://github.com/Stirling-Tools/Stirling-PDF/blob/main/src/main/resources/messages_en_GB.properties

Copy and rename it to messages_{your data-language-code here}.properties, in the polish example you would set the name to messages_pl_PL.properties

Then simply translate all property entries within that file and make a PR into main for others to use!

If you do not have a java IDE i am happy to verify the changes worked once you raise PR (but wont be able to verify the translations themselves)

1
https://gitee.com/jeady5/Stirling-PDF.git
git@gitee.com:jeady5/Stirling-PDF.git
jeady5
Stirling-PDF
Stirling-PDF
main

搜索帮助

53164aa7 5694891 3bd8fe86 5694891