refactor: translations template file and crowdin settings
This commit is contained in:
parent
3157599166
commit
01abee00a6
7 changed files with 15 additions and 1867 deletions
23
README.md
23
README.md
|
@ -131,29 +131,22 @@ release comes.
|
|||
## Translating
|
||||
|
||||
ATLauncher is written for English speakers. All our translations are community run by those who
|
||||
submit pull requests to update the text to a different language.
|
||||
take their time and submit updates to the text in a different language.
|
||||
|
||||
Languages are contained within the `src\main\resources\assets\lang` directory and are based off the
|
||||
master template file at `src\main\resources\assets\lang\template.pot`.
|
||||
|
||||
To create a new language you can copy this file and then name it with the locale name and `.po` as
|
||||
the extension.
|
||||
|
||||
For instance for French, it is `src\main\resources\assets\lang\fr.po`.
|
||||
|
||||
While you can make changes to the files manually, using a tool like [POEdit](https://poedit.net/) is
|
||||
recommended.
|
||||
If you wish to help translate ATLauncher, please visit our page on
|
||||
[Crowdin](https://crowdin.com/project/atlauncher) and start translating.
|
||||
|
||||
### Updating the template file
|
||||
|
||||
If new strings are added to the launcher, the template file will need to be updated in order to
|
||||
take into account the new strings.
|
||||
|
||||
In order to do this, run `./gradlew generatePots` which will scan the source files and update the
|
||||
`src\main\resources\assets\lang\template.pot` file.
|
||||
In order to do this, run `./gradlew generatePots` which will scan the source files and create a
|
||||
`build/gettext/translations.pot` file.
|
||||
|
||||
Note that our of the box, this will not generate in the correct format. The file should be opened
|
||||
with [POEdit](https://poedit.net/), which will automatically fix the file, which then you can save.
|
||||
Note that out of the box, this will not generate in the correct format. The file should be opened
|
||||
with [POEdit](https://poedit.net/), which will automatically fix the file, which then you can save
|
||||
to `translations.pot` in the root directory, which will then get picked up by Crowdin.
|
||||
|
||||
## Need Help/Have Questions?
|
||||
|
||||
|
|
13
build.gradle
13
build.gradle
|
@ -78,10 +78,10 @@ jar {
|
|||
}
|
||||
|
||||
gettext {
|
||||
template {
|
||||
translations {
|
||||
srcDir = 'src'
|
||||
include = 'main/java/com/atlauncher/**/*.java'
|
||||
outputFilename = 'template.pot'
|
||||
outputFilename = 'translations.pot'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,14 +157,8 @@ task createMacApp(type: Zip) {
|
|||
archiveName = "${project.name}-${project.version}.zip"
|
||||
}
|
||||
|
||||
task copyTemplatePot(type: Copy) {
|
||||
dependsOn generatePots
|
||||
from "${projectDir}/build/gettext/template.pot"
|
||||
into "${projectDir}/src/main/resources/assets/lang"
|
||||
}
|
||||
|
||||
copyArtifacts.finalizedBy {
|
||||
println 'ATLauncher has been built. Distribution files are located in the dist directory'
|
||||
println 'ATLauncher has been built. Distribution files are located in the dist directory.'
|
||||
}
|
||||
|
||||
clean.doFirst {
|
||||
|
@ -174,4 +168,3 @@ clean.doFirst {
|
|||
build.finalizedBy copyArtifacts
|
||||
shadowJar.dependsOn jar
|
||||
build.dependsOn createExe, createMacApp
|
||||
generatePots.finalizedBy copyTemplatePot
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
files:
|
||||
- source: /src/main/resources/assets/lang/template.pot
|
||||
translation: /src/main/resources/assets/lang/%two_letters_code%.pot
|
||||
- source: /translations.pot
|
||||
translation: /src/main/resources/assets/lang/%locale_with_underscore%.po
|
||||
|
|
|
@ -563,7 +563,7 @@ public class InstanceV2 extends MinecraftVersion {
|
|||
// OpenEye returned a response to the report, display that to user if needed.
|
||||
LogManager.info("OpenEye: Pending crash report sent! URL: " + response.getURL());
|
||||
if (response.hasNote()) {
|
||||
int ret = DialogManager.optionDialog().setTitle(GetText.tr("instance.aboutyourcrash"))
|
||||
int ret = DialogManager.optionDialog().setTitle(GetText.tr("About Your Crash"))
|
||||
.setContent(HTMLUtils.centerParagraph(GetText.tr(
|
||||
"We detected a previous unreported crash generated by the OpenEye mod.<br/><br/>This has now been sent off to OpenEye and you can open the crash report below or continue without viewing it.")
|
||||
+ "<br/><br/>" + response.getNoteDisplay()
|
||||
|
|
0
src/main/resources/assets/lang/.gitkeep
Normal file
0
src/main/resources/assets/lang/.gitkeep
Normal file
File diff suppressed because it is too large
Load diff
|
@ -118,6 +118,7 @@ msgid "Logging Into Minecraft"
|
|||
msgstr ""
|
||||
|
||||
#: src\main\java\com\atlauncher\data\Instance.java:1559
|
||||
#: src\main\java\com\atlauncher\data\InstanceV2.java:566
|
||||
#: src\main\java\com\atlauncher\data\MinecraftError.java:39
|
||||
#: src\main\java\com\atlauncher\data\MinecraftError.java:46
|
||||
msgid "About Your Crash"
|
||||
|
@ -193,10 +194,6 @@ msgstr ""
|
|||
msgid "Preparing For Launch"
|
||||
msgstr ""
|
||||
|
||||
#: src\main\java\com\atlauncher\data\InstanceV2.java:566
|
||||
msgid "instance.aboutyourcrash"
|
||||
msgstr ""
|
||||
|
||||
#. {0} is the name of a mod that was installed
|
||||
#: src\main\java\com\atlauncher\data\InstanceV2.java:657
|
||||
msgid "{0} Installed"
|
Loading…
Reference in a new issue