Skip to content

Commit

Permalink
#34: Use Project Fluent for translation and integrate Crowdin
Browse files Browse the repository at this point in the history
  • Loading branch information
mtkennerly committed May 27, 2022
1 parent df41bfc commit bbf28aa
Show file tree
Hide file tree
Showing 9 changed files with 372 additions and 372 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,4 +2,5 @@ bin/
dist/
obj/
tmp/
vendor/
*.sln
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,10 @@
## Unreleased

* Changed:
* Localization now uses [Project Fluent](https://projectfluent.org) instead of pure C# code internally.
Although English currently remains the only language supported, this change
should make it easier for other people to contribute. If you'd like to help,
[check out the new Crowdin project](https://crowdin.com/project/ludusavi-playnite).
* The `ludusavi-skip` tag is now `[Ludusavi] Skip`.
If you were using the old tag, it will be automatically renamed for you.
* Added:
Expand Down
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -12,6 +12,9 @@ is ultimately sourced from [PCGamingWiki](https://www.pcgamingwiki.com/wiki/Home
so please contribute any new or fixed data back to the wiki itself, and your
improvements will be incorporated into Ludusavi's data as well.

If you'd like to help translate this plugin into other languages,
[check out the Crowdin project](https://crowdin.com/project/ludusavi-playnite).

## Setup
### Ludusavi
Refer to the [Ludusavi project](https://github.com/mtkennerly/ludusavi)
Expand Down
10 changes: 10 additions & 0 deletions crowdin.yml
@@ -0,0 +1,10 @@
project_id: "518284"
base_path: .
base_url: https://api.crowdin.com

preserve_hierarchy: true

files:
- source: /lang/en-US.ftl
translation: /lang/%locale%.ftl
update_option: update_as_unapproved
96 changes: 96 additions & 0 deletions lang/en-US.ftl
@@ -0,0 +1,96 @@
ludusavi = Ludusavi
file-filter-executable = Executable
button-browse = Browse
button-open = Open
button-yes = Yes
button-yes-remembered = Yes, always
button-no = No
button-no-remembered = No, never
label-launch = Launch
may-need-custom-entry = {$total-custom ->
[0] {""}
[one] This game requires a matching custom entry in {ludusavi}.
*[other] {$total-custom} games require a matching custom entry in {ludusavi}.
}
## Backup

back-up-specific-game =
.confirm = Back up save data for {$game}? {may-need-custom-entry}
.on-success = Backed up saves for {$game} ({$processed-size})
.on-empty = No save data found to back up for {$game}
.on-failure = Backed up saves for {$game} ({$processed-size} of {$total-size}), but some saves failed
# Defers to `back-up-specific-game.*`.
back-up-last-game = Back up save data for last game played
# Defers to `back-up-specific-game.*` for each game individually.
# In `.confirm`, there will always be more than one game.
back-up-selected-games = Back up save data for selected games
.confirm = Back up save data for {$total-games} selected games? {may-need-custom-entry}
back-up-all-games = Back up save data for all games
.confirm = Back up save data for all games that Ludusavi can find?
.on-success = Backed up saves for {$processed-games} games ({$processed-size}); click for full list
.on-failure = Backed up saves for {$processed-games} of {$total-games} games ({$processed-size} of {$total-size}), but some failed; click for full list
## Restore

restore-specific-game =
.confirm = Restore save data for {$game}? {may-need-custom-entry}
.on-success = Restored saves for {$game} ({$processed-size})
.on-empty = No save data found to restore for {$game}
.on-failure = Restored saves for {$game} ({$processed-size} of {$total-size}), but some saves failed
# Defers to `restore-specific-game.*`.
restore-last-game = Restore save data for last game played
# Defers to `restore-specific-game.*` for each game individually.
# In `.confirm`, there will always be more than one game.
restore-selected-games = Restore save data for selected games
.confirm = Restore save data for {$total-games} selected games? {may-need-custom-entry}
restore-all-games = Restore save data for all games
.confirm = Restore save data for all games that Ludusavi can find?
.on-success = Restored saves for {$processed-games} games ({$processed-size}); click for full list
.on-failure = Restored saves for {$processed-games} of {$total-games} games ({$processed-size} of {$total-size}), but some failed; click for full list
## Tags

add-tag-for-selected-games = Tag: "{$tag}" - Add for selected games
.confirm = Add "{$tag}" tag for {$total-games} selected games and remove any conflicting tags?
remove-tag-for-selected-games = Tag: "{$tag}" - Remove for selected games
.confirm = Remove "{$tag}" tag for {$total-games} selected games and remove any conflicting tags?
## Generic errors

operation-still-pending = {ludusavi} is still working on a previous request. Please try again when you see the notification that it's done.
no-game-played-yet = You haven't played anything yet in this session.
unable-to-run-ludusavi = Unable to run {ludusavi}.
## Full backup/restore error reporting

full-list-game-line-item = {$status ->
[failed] [FAILED] {$game} ({$size})
[ignored] [IGNORED] {$game} ({$size})
*[success] {$game} ({$size})
}
## Settings

config-executable-path = Name or full path of the Ludusavi executable:
config-backup-path = Full path to directory for storing backups:
config-do-backup-on-game-stopped = Back up save data for a game after playing it
config-do-restore-on-game-starting = Also restore save data for a game before playing it
config-ask-backup-on-game-stopped = Ask first instead of doing it automatically
config-only-backup-on-game-stopped-if-pc = Only do this for PC games
config-add-suffix-for-non-pc-game-names = Look up non-PC games by adding this suffix to their names (requires custom entry):
config-retry-non-pc-games-without-suffix = If not found with the suffix, then try again without it
config-do-platform-backup-on-non-pc-game-stopped = Back up save data by platform name after playing non-PC games (requires custom entry)
config-do-platform-restore-on-non-pc-game-starting = Also restore save data by platform name before playing non-PC games
config-ask-platform-backup-on-non-pc-game-stopped = Ask first instead of doing it automatically
config-ignore-benign-notifications = Only show notifications on failure
2 changes: 1 addition & 1 deletion src/LudusaviPlaynite.cs
Expand Up @@ -64,7 +64,7 @@ public class LudusaviPlaynite : GenericPlugin

public LudusaviPlaynite(IPlayniteAPI api) : base(api)
{
translator = new Translator(DetermineLanguage());
translator = new Translator(PlayniteApi.ApplicationSettings.Language);
settings = new LudusaviPlayniteSettings(this, translator);
Properties = new GenericPluginProperties
{
Expand Down
9 changes: 9 additions & 0 deletions src/LudusaviPlaynite.csproj
Expand Up @@ -27,4 +27,13 @@
</None>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="../lang/*.ftl" />
</ItemGroup>

<!-- TODO: remove when Linguini 0.3.0+ is released -->
<ItemGroup>
<ProjectReference Include="../vendor/Linguini/Linguini.Bundle/Linguini.Bundle.csproj" />
</ItemGroup>

</Project>

0 comments on commit bbf28aa

Please sign in to comment.