<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Locale</title><link>https://sourceforge.net/p/griefprevention3d/wiki/Locale/</link><description>Recent changes to Locale</description><atom:link href="https://sourceforge.net/p/griefprevention3d/wiki/Locale/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 02 Jul 2026 13:04:32 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/griefprevention3d/wiki/Locale/feed" rel="self" type="application/rss+xml"/><item><title>Locale modified by Jack Korte</title><link>https://sourceforge.net/p/griefprevention3d/wiki/Locale/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,27 +1,43 @@
 # Locale System

-GriefPrevention3D supports localized messages via YAML locale files. The plugin loads messages based on the `GriefPrevention.Locale` config setting.
+GriefPrevention3D supports localized messages via YAML locale files. The plugin loads messages based on the `GriefPrevention.Locale` config setting, and can also send messages in a player's own language with per-player locale support.

 ## Quick Start

-1. Set your locale in `config.yml`:

-   ```yaml
-   GriefPrevention:
-     Locale: es
-   ```
+### Server Language

-2. Copy the desired locale file from `Lang/` to the data folder root:

-   ```
-   GriefPreventionData/
-     Lang/
-       messages_en.yml      &amp;lt;- bundled reference copies (refreshed on restart)
-       messages_es.yml
-       messages_pt_BR.yml
-     messages_es.yml         &amp;lt;- your active locale file (copied here by you)
-     config.yml
-   ```
+To change the server's default language, set the locale code in `config.yml`:

-3. Restart the server or run `/greload`.

+    :::yaml
+    GriefPrevention:
+      Locale: es
+
+Then either:
+
+- **Copy** the desired locale file from the `Lang/` folder to the data folder root:
+  ```
+  GriefPreventionData/
+    Lang/
+      messages_en.yml      &amp;lt;- bundled reference copies (refreshed on restart)
+      messages_es.yml
+      messages_pt_BR.yml
+    messages_es.yml         &amp;lt;- your active locale file (copied here by you)
+    config.yml
+  ```
+
+- **Or** just set `Locale:` in config.yml and delete or move any old `messages_*.yml` files — the plugin will extract the matching locale file automatically on the next restart or `/greload`.
+
+Restart the server or run `/greload`.
+
+### Per-Player Language (Automatic)
+
+Players with a Spanish or Portuguese Minecraft client locale will receive messages in their language automatically — no configuration needed. This is enabled by default with:
+
+    :::yaml
+    GriefPrevention:
+      PerPlayerLocale: true
+
+See [Per-Player Locale](Key-Features#per-player-locale) for details.

 ## File Locations

@@ -65,9 +81,10 @@
 ## Adding a New Locale


 1. Create `messages_{locale}.yml` in the JAR's resource path (under `src/main/resources/`)
-2. Add the locale to `BUNDLED_LOCALE_FILES` in `DataStore.java`
-3. Add locale entries to `startups.txt` (e.g., `fr1[...`, `fr2[...`, `fr3[...`)
-4. The plugin will extract it to `Lang/` on next restart
+2. Add the locale code to `SUPPORTED_LOCALE_CODES` in `MessageLocalization.java`
+3. Add the filename to `BUNDLED_LOCALE_FILES` in `MessageLocalization.java`
+4. Add locale entries to `startups.txt` (e.g., `fr1[...`, `fr2[...`, `fr3[...`)
+5. The plugin will extract it to `Lang/` on next restart

 ## Editing Messages

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jack Korte</dc:creator><pubDate>Thu, 02 Jul 2026 13:04:32 -0000</pubDate><guid>https://sourceforge.netb9dd1f500ae277841bcc6e5395a1006b6eee9179</guid></item><item><title>Locale modified by Jack Korte</title><link>https://sourceforge.net/p/griefprevention3d/wiki/Locale/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="h-locale-system"&gt;Locale System&lt;/h1&gt;
&lt;p&gt;GriefPrevention3D supports localized messages via YAML locale files. The plugin loads messages based on the &lt;code&gt;GriefPrevention.Locale&lt;/code&gt; config setting.&lt;/p&gt;
&lt;h2 id="h-quick-start"&gt;Quick Start&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Set your locale in &lt;code&gt;config.yml&lt;/code&gt;:&lt;br/&gt;
&lt;code&gt;yaml
   GriefPrevention:
     Locale: es&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copy the desired locale file from &lt;code&gt;Lang/&lt;/code&gt; to the data folder root:&lt;br/&gt;
&lt;code&gt;GriefPreventionData/
     Lang/
       messages_en.yml      &amp;lt;- bundled reference copies (refreshed on restart)
       messages_es.yml
       messages_pt_BR.yml
     messages_es.yml         &amp;lt;- your active locale file (copied here by you)
     config.yml&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Restart the server or run &lt;code&gt;/greload&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="h-file-locations"&gt;File Locations&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GriefPreventionData/messages_{locale}.yml&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Active locale files read by the plugin&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GriefPreventionData/Lang/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Reference copies extracted from JAR on every restart&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GriefPreventionData/messages.yml&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Legacy file (backward compatibility)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="h-loading-priority"&gt;Loading Priority&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;messages_{locale}.yml&lt;/code&gt;&lt;/strong&gt; — matches your &lt;code&gt;config_locale&lt;/code&gt; setting (e.g., &lt;code&gt;messages_es.yml&lt;/code&gt; for &lt;code&gt;Locale: es&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;messages.yml&lt;/code&gt;&lt;/strong&gt; — legacy fallback for servers migrated from older versions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Auto-detect&lt;/strong&gt; — if neither exists, scans for any &lt;code&gt;messages_*.yml&lt;/code&gt; and auto-switches&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Extract from JAR&lt;/strong&gt; — if nothing found, extracts the matching locale from the JAR&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="h-auto-detection"&gt;Auto-Detection&lt;/h2&gt;
&lt;p&gt;If your config says &lt;code&gt;Locale: en&lt;/code&gt; but only &lt;code&gt;messages_es.yml&lt;/code&gt; exists in the data folder, the plugin auto-switches to Spanish and logs:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Locale 'en' didn't match provided messages_es.yml. Auto-switched to 'es'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The in-memory locale is updated so the startup header and all messages use the detected language.&lt;/p&gt;
&lt;h2 id="h-key-merging"&gt;Key Merging&lt;/h2&gt;
&lt;p&gt;On every startup, the plugin compares your deployed locale file against the bundled JAR version. Any missing keys are automatically added and saved to your file. This means:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;New messages added in plugin updates appear automatically after restart&lt;/li&gt;
&lt;li&gt;You don't need to manually edit your locale file when upgrading&lt;/li&gt;
&lt;li&gt;Your customizations are preserved (existing keys are never overwritten)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="h-supported-locales"&gt;Supported Locales&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Locale&lt;/th&gt;
&lt;th&gt;Language&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;en&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;English&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;es&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Spanish&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;pt_BR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Brazilian Portuguese&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="h-adding-a-new-locale"&gt;Adding a New Locale&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;messages_{locale}.yml&lt;/code&gt; in the JAR's resource path (under &lt;code&gt;src/main/resources/&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Add the locale to &lt;code&gt;BUNDLED_LOCALE_FILES&lt;/code&gt; in &lt;code&gt;DataStore.java&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Add locale entries to &lt;code&gt;startups.txt&lt;/code&gt; (e.g., &lt;code&gt;fr1[...&lt;/code&gt;, &lt;code&gt;fr2[...&lt;/code&gt;, &lt;code&gt;fr3[...&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;The plugin will extract it to &lt;code&gt;Lang/&lt;/code&gt; on next restart&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="h-editing-messages"&gt;Editing Messages&lt;/h2&gt;
&lt;p&gt;Each message is stored under a &lt;code&gt;Messages.&lt;/code&gt; key matching the enum name in &lt;code&gt;Messages.java&lt;/code&gt;:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;Messages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;ClaimCreated&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"Claims&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;created&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;successfully."&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;NoPermission&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"You&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;don't&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;have&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;permission&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;to&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;do&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;that."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can customize any message by editing the corresponding key in your locale file. The plugin uses &lt;code&gt;$&lt;/code&gt; or &lt;code&gt;&amp;amp;&lt;/code&gt; as color code prefixes, and supports &lt;code&gt;&amp;amp;#RRGGBB&lt;/code&gt; hex colors.&lt;/p&gt;
&lt;h2 id="h-startup-header"&gt;Startup Header&lt;/h2&gt;
&lt;p&gt;The startup header respects your locale setting. If you have locale entries in &lt;code&gt;startups.txt&lt;/code&gt; matching your config (e.g., &lt;code&gt;es1[...&lt;/code&gt;, &lt;code&gt;es2[...&lt;/code&gt;, &lt;code&gt;es3[...&lt;/code&gt;), the plugin displays a localized header on startup.&lt;/p&gt;
&lt;p&gt;For locales with a region suffix (e.g., &lt;code&gt;pt_BR&lt;/code&gt;), the header falls back to the base language (e.g., &lt;code&gt;pt&lt;/code&gt;) if no exact match is found.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jack Korte</dc:creator><pubDate>Thu, 02 Jul 2026 13:04:31 -0000</pubDate><guid>https://sourceforge.net4f8bc8496753528001d828a2cc8aa5a12e99a62b</guid></item></channel></rss>