<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.shroudforge.net/index.php?action=history&amp;feed=atom&amp;title=Translate_mod_text%2Ffr</id>
	<title>Translate mod text/fr - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.shroudforge.net/index.php?action=history&amp;feed=atom&amp;title=Translate_mod_text%2Ffr"/>
	<link rel="alternate" type="text/html" href="https://wiki.shroudforge.net/index.php?title=Translate_mod_text/fr&amp;action=history"/>
	<updated>2026-11-07T23:13:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://wiki.shroudforge.net/index.php?title=Translate_mod_text/fr&amp;diff=2654&amp;oldid=prev</id>
		<title>Bonsaibauer: Importing a new version from external source</title>
		<link rel="alternate" type="text/html" href="https://wiki.shroudforge.net/index.php?title=Translate_mod_text/fr&amp;diff=2654&amp;oldid=prev"/>
		<updated>2026-11-07T01:55:50Z</updated>

		<summary type="html">&lt;p&gt;Importing a new version from external source&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ShroudForge Modloader Wiki Post&lt;br /&gt;
title: Translate mod text&lt;br /&gt;
description: Translate visible Modloader text and Lua text from the same locale files in the mod folder. Read the Modloader language through shroudforge.locale(), added by PR #42.&lt;br /&gt;
language: en-GB&lt;br /&gt;
picture:ShroudForge-Wiki-modding-locales.svg&lt;br /&gt;
creator: Bonsaibauer&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:ShroudForge-Wiki-modding-locales.svg|thumb|left|600px|Translate mod text]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Les textes visibles dans le Modloader et les textes Lua utilisent les mêmes fichiers de langue du mod. La langue choisie dans le Modloader se lit avec &amp;lt;code&amp;gt;shroudforge.locale()&amp;lt;/code&amp;gt;, ajoutée par la PR #42.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;Locale_files&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Fichiers de langue ==&lt;br /&gt;
&lt;br /&gt;
Ajoutez un fichier &amp;lt;code&amp;gt;locales/&amp;amp;lt;code&amp;amp;gt;.json&amp;lt;/code&amp;gt; par langue. Les codes actuels du sélecteur du Modloader sont &amp;lt;code&amp;gt;de&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;de-AT&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;de-CH&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;en-GB&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;en-US&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;es&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;fr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hi&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;it&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ja&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;nl&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pl&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sv&amp;lt;/code&amp;gt; et &amp;lt;code&amp;gt;zh&amp;lt;/code&amp;gt;. Le nom du fichier reprend exactement le code. Ces fichiers accompagnent &amp;lt;code&amp;gt;mod.json&amp;lt;/code&amp;gt; et &amp;lt;code&amp;gt;extended.mod.json&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Le schéma est publié sous [https://bonsaibauer.github.io/shroudforge/schemas/mod-locale.schema.json &amp;lt;code&amp;gt;mod-locale.schema.json&amp;lt;/code&amp;gt;]. Le catalogue peut traduire &amp;lt;code&amp;gt;mod.name&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mod.description&amp;lt;/code&amp;gt;, les libellés des paramètres et des options, les groupes, les actions, les notes de version et les chaînes Lua sous &amp;lt;code&amp;gt;strings&amp;lt;/code&amp;gt;. Les fichiers peuvent être incomplets. Le texte source est conservé pour les traductions manquantes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;$schema&amp;quot;: &amp;quot;https://bonsaibauer.github.io/shroudforge/schemas/mod-locale.schema.json&amp;quot;,&lt;br /&gt;
  &amp;quot;settings&amp;quot;: {&lt;br /&gt;
    &amp;quot;severity&amp;quot;: {&lt;br /&gt;
      &amp;quot;label&amp;quot;: &amp;quot;Niveau du journal&amp;quot;,&lt;br /&gt;
      &amp;quot;options&amp;quot;: { &amp;quot;info&amp;quot;: &amp;quot;Information&amp;quot;, &amp;quot;warn&amp;quot;: &amp;quot;Avertissement&amp;quot; }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;groups&amp;quot;: [&lt;br /&gt;
    { &amp;quot;label&amp;quot;: &amp;quot;Journal&amp;quot;, &amp;quot;actions&amp;quot;: { &amp;quot;write&amp;quot;: { &amp;quot;label&amp;quot;: &amp;quot;Écrire un message&amp;quot; } } }&lt;br /&gt;
  ],&lt;br /&gt;
  &amp;quot;strings&amp;quot;: { &amp;quot;overlay.ready&amp;quot;: &amp;quot;Prêt&amp;quot; }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Les clés des paramètres et des options restent identiques à celles de &amp;lt;code&amp;gt;extended.mod.json&amp;lt;/code&amp;gt;. Les groupes suivent le même ordre que dans ce fichier. Les traductions d’action utilisent leur identifiant existant. Les valeurs enregistrées ne changent pas.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;Use_the_same_text_in_Lua&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Utiliser les mêmes textes dans Lua ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local locale = shroudforge.locale()&lt;br /&gt;
local ready = shroudforge.i18n.get(&amp;quot;overlay.ready&amp;quot;, locale, &amp;quot;Ready&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;shroudforge.i18n.get(key, locale, fallback)&amp;lt;/code&amp;gt; utilise le même catalogue chargé que le Modloader. Le code régional, comme &amp;lt;code&amp;gt;de-AT&amp;lt;/code&amp;gt;, est recherché avant sa langue &amp;lt;code&amp;gt;de&amp;lt;/code&amp;gt;. Si le texte manque, la fonction renvoie le texte de remplacement ou la clé. La recherche ne relit pas les fichiers. La PR #42 fournit l’API de langue, puis cette fonctionnalité la relie au catalogue de chaque mod.&lt;br /&gt;
&lt;br /&gt;
Si &amp;lt;code&amp;gt;shroudforge.locale()&amp;lt;/code&amp;gt; renvoie &amp;lt;code&amp;gt;en&amp;lt;/code&amp;gt; parce que la configuration est illisible, la recherche consulte d’abord &amp;lt;code&amp;gt;en-GB.json&amp;lt;/code&amp;gt;, puis &amp;lt;code&amp;gt;en.json&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;en-GB&amp;lt;/code&amp;gt; est la langue anglaise par défaut du Modloader. &amp;lt;code&amp;gt;en-US&amp;lt;/code&amp;gt; reste disponible comme variante sélectionnée explicitement.&lt;br /&gt;
&lt;br /&gt;
Les fichiers de langue ne nécessitent pas la capacité runtime. Les textes de l’interface ShroudForge restent dans les traductions communes du Modloader.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:guide:Shroudforge]]&lt;/div&gt;</summary>
		<author><name>Bonsaibauer</name></author>
	</entry>
</feed>