-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add minecraft translation modules
- Loading branch information
1 parent
d5e7234
commit fe1a709
Showing
13 changed files
with
230 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
plugins { | ||
id("cloud-translations.base-conventions") | ||
id("cloud-translations.publishing-conventions") | ||
} | ||
|
||
dependencies { | ||
api(projects.cloudTranslationsCore) | ||
} |
58 changes: 58 additions & 0 deletions
58
...s-bukkit/src/main/java/org/incendo/cloud/translations/bukkit/BukkitTranslationBundle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// MIT License | ||
// | ||
// Copyright (c) 2024 Incendo | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
// | ||
package org.incendo.cloud.translations.bukkit; | ||
|
||
import org.apiguardian.api.API; | ||
import org.checkerframework.checker.nullness.qual.NonNull; | ||
import org.incendo.cloud.CommandManager; | ||
import org.incendo.cloud.caption.CaptionProvider; | ||
import org.incendo.cloud.caption.CaptionRegistry; | ||
import org.incendo.cloud.translations.LocaleExtractor; | ||
import org.incendo.cloud.translations.TranslationBundle; | ||
|
||
/** | ||
* A bundle of Bukkit translations. | ||
* | ||
* <p>This can be registered to the command manager by accessing the caption registry using | ||
* {@link CommandManager#captionRegistry()} and then registering the provider using | ||
* {@link CaptionRegistry#registerProvider(CaptionProvider)}: | ||
* <pre>{@code TranslationBundle<C> bundle = BukkitTranslationBundle.bukkit(sender -> sender.locale()); | ||
* manager.captionRegistry().registerProvider(translationBundle);}</pre> | ||
*/ | ||
@API(status = API.Status.STABLE) | ||
public final class BukkitTranslationBundle { | ||
|
||
/** | ||
* Returns the translation bundle for cloud-bukkit translations. | ||
* | ||
* @param <C> command sender type | ||
* @param localeExtractor locale extractor | ||
* @return the translation bundle | ||
*/ | ||
public static <C> @NonNull TranslationBundle<C> bukkit( | ||
final @NonNull LocaleExtractor<C> localeExtractor | ||
) { | ||
return TranslationBundle.resourceBundle("org.incendo.cloud.bukkit.lang.messages", localeExtractor); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...translations-bukkit/src/main/java/org/incendo/cloud/translations/bukkit/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* cloud-bukkit translations. | ||
*/ | ||
package org.incendo.cloud.translations.bukkit; |
11 changes: 11 additions & 0 deletions
11
...-translations-bukkit/src/main/resources/org/incendo/cloud/bukkit/lang/messages.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
argument.parse.failure.enchantment='<input>' is not a valid enchantment | ||
argument.parse.failure.material='<input>' is not a valid material name | ||
argument.parse.failure.offlineplayer=No player found for input '<input>' | ||
argument.parse.failure.player=No player found for input '<input>' | ||
argument.parse.failure.world='<input>' is not a valid Minecraft world | ||
argument.parse.failure.selector.unsupported=Entity selector argument type not supported below Minecraft 1.13. | ||
argument.parse.failure.location.invalid_format='<input>' is not a valid location. Required format is '<x> <y> <z>' | ||
argument.parse.failure.location.mixed_local_absolute=Cannot mix local and absolute coordinates. (either all coordinates use '^' or none do) | ||
argument.parse.failure.namespacedkey.namespace=Invalid namespace '<input>'. Must be [a-z0-9._-] | ||
argument.parse.failure.namespacedkey.key=Invalid key '<input>'. Must be [a-z0-9/._-] | ||
argument.parse.failure.namespacedkey.need_namespace=Invalid input '<input>', requires an explicit namespace. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
plugins { | ||
id("cloud-translations.base-conventions") | ||
id("cloud-translations.publishing-conventions") | ||
} | ||
|
||
dependencies { | ||
api(projects.cloudTranslationsCore) | ||
} |
58 changes: 58 additions & 0 deletions
58
...s-bungee/src/main/java/org/incendo/cloud/translations/bungee/BungeeTranslationBundle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// MIT License | ||
// | ||
// Copyright (c) 2024 Incendo | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
// | ||
package org.incendo.cloud.translations.bungee; | ||
|
||
import org.apiguardian.api.API; | ||
import org.checkerframework.checker.nullness.qual.NonNull; | ||
import org.incendo.cloud.CommandManager; | ||
import org.incendo.cloud.caption.CaptionProvider; | ||
import org.incendo.cloud.caption.CaptionRegistry; | ||
import org.incendo.cloud.translations.LocaleExtractor; | ||
import org.incendo.cloud.translations.TranslationBundle; | ||
|
||
/** | ||
* A bundle of Bungee translations. | ||
* | ||
* <p>This can be registered to the command manager by accessing the caption registry using | ||
* {@link CommandManager#captionRegistry()} and then registering the provider using | ||
* {@link CaptionRegistry#registerProvider(CaptionProvider)}: | ||
* <pre>{@code TranslationBundle<C> bundle = BungeeTranslationBundle.bungee(sender -> sender.locale()); | ||
* manager.captionRegistry().registerProvider(translationBundle);}</pre> | ||
*/ | ||
@API(status = API.Status.STABLE) | ||
public final class BungeeTranslationBundle { | ||
|
||
/** | ||
* Returns the translation bundle for cloud-bungee translations. | ||
* | ||
* @param <C> command sender type | ||
* @param localeExtractor locale extractor | ||
* @return the translation bundle | ||
*/ | ||
public static <C> @NonNull TranslationBundle<C> bungee( | ||
final @NonNull LocaleExtractor<C> localeExtractor | ||
) { | ||
return TranslationBundle.resourceBundle("org.incendo.cloud.bukkit.lang.messages", localeExtractor); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...translations-bungee/src/main/java/org/incendo/cloud/translations/bungee/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* cloud-bungee translations. | ||
*/ | ||
package org.incendo.cloud.translations.bungee; |
2 changes: 2 additions & 0 deletions
2
...-translations-bungee/src/main/resources/org/incendo/cloud/bungee/lang/messages.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
argument.parse.failure.player='<input>' is not a valid player | ||
argument.parse.failure.server='<input>' is not a valid server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
plugins { | ||
id("cloud-translations.base-conventions") | ||
id("cloud-translations.publishing-conventions") | ||
} | ||
|
||
dependencies { | ||
api(projects.cloudTranslationsCore) | ||
} |
58 changes: 58 additions & 0 deletions
58
...city/src/main/java/org/incendo/cloud/translations/velocity/VelocityTranslationBundle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// MIT License | ||
// | ||
// Copyright (c) 2024 Incendo | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
// | ||
package org.incendo.cloud.translations.velocity; | ||
|
||
import org.apiguardian.api.API; | ||
import org.checkerframework.checker.nullness.qual.NonNull; | ||
import org.incendo.cloud.CommandManager; | ||
import org.incendo.cloud.caption.CaptionProvider; | ||
import org.incendo.cloud.caption.CaptionRegistry; | ||
import org.incendo.cloud.translations.LocaleExtractor; | ||
import org.incendo.cloud.translations.TranslationBundle; | ||
|
||
/** | ||
* A bundle of Velocity translations. | ||
* | ||
* <p>This can be registered to the command manager by accessing the caption registry using | ||
* {@link CommandManager#captionRegistry()} and then registering the provider using | ||
* {@link CaptionRegistry#registerProvider(CaptionProvider)}: | ||
* <pre>{@code TranslationBundle<C> bundle = VelocityTranslationBundle.velocity(sender -> sender.locale()); | ||
* manager.captionRegistry().registerProvider(translationBundle);}</pre> | ||
*/ | ||
@API(status = API.Status.STABLE) | ||
public final class VelocityTranslationBundle { | ||
|
||
/** | ||
* Returns the translation bundle for cloud-velocity translations. | ||
* | ||
* @param <C> command sender type | ||
* @param localeExtractor locale extractor | ||
* @return the translation bundle | ||
*/ | ||
public static <C> @NonNull TranslationBundle<C> velocity( | ||
final @NonNull LocaleExtractor<C> localeExtractor | ||
) { | ||
return TranslationBundle.resourceBundle("org.incendo.cloud.bukkit.lang.messages", localeExtractor); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...slations-velocity/src/main/java/org/incendo/cloud/translations/velocity/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* cloud-velocity translations. | ||
*/ | ||
package org.incendo.cloud.translations.velocity; |
2 changes: 2 additions & 0 deletions
2
...nslations-velocity/src/main/resources/org/incendo/cloud/velocity/lang/messages.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
argument.parse.failure.player='<input>' is not a valid player | ||
argument.parse.failure.server='<input>' is not a valid server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters