MDN/Development/CompatibilityTables/Translation: Difference between revisions

Update EmbedCompatTable section for L10n:CompatTable macro
(Added section for viewing translated content)
(Update EmbedCompatTable section for L10n:CompatTable macro)
Line 11: Line 11:
== <nowiki>{{EmbedCompatTable}}</nowiki> KumaScript macro ==
== <nowiki>{{EmbedCompatTable}}</nowiki> KumaScript macro ==


The EmbedCompatTable macro has some support for translations:
The EmbedCompatTable macro uses the L10n:CompatTable macro for translated strings:


https://developer.mozilla.org/en-US/docs/Template:EmbedCompatTable
https://developer.mozilla.org/en-US/docs/Template:L10n:CompatTable


The page's locale will be used to lookup strings in <code>langDictionary</code>, and use the locale's variants if available.  This includes support text such as "Yes", "No" and "Partial" and feature text such as "Basic Support", "Experimental", and "Non-Standard".
The page's locale will be used to lookup strings, and use the locale's variants if available.  This includes support text such as "Yes", "No" and "Partial" and feature text such as "Basic Support", "Experimental", and "Non-Standard".


Web/JavaScript/Reference/Global_Objects/Promise is a simple page:
Web/JavaScript/Reference/Global_Objects/Promise is a simple page:
Line 27: Line 27:


=== Adding a locale ===
=== Adding a locale ===
To add a new locale,
To add a new locale, modify [https://developer.mozilla.org/en-US/docs/Template:L10n:CompatTable L10n:CompatTable] to add your locale's translations.  A safe way to do this:


# Copy the latest code from https://developer.mozilla.org/en-US/docs/Template:EmbedCompatTable to https://developer.allizom.org/en-US/docs/Template:EmbedCompatTable (the MDN staging environment)
# Copy the latest code from https://developer.mozilla.org/en-US/docs/Template:EmbedCompatTable and https://developer.mozilla.org/en-US/docs/Template:L10n:CompatTable to https://developer.allizom.org/en-US/docs/Template:EmbedCompatTable and https://developer.allizom.org/en-US/docs/Template:L10n:CompatTable (the MDN staging environment)
# Copy the <code>"en-US"</code> entry of <code>langDictionary</code>, renaming it to the target locale
# Add your locale on the staging copy of L10n:CompatTable
# Translate the strings in the new copy
# Try it out on staging, adding the <nowiki>{{EmbedCompatTable}}</nowiki> macro to target pages as needed
# Try it out on staging, adding the <nowiki>{{EmbedCompatTable}}</nowiki> macro as needed
# When it is working, copy it back to the production version
# When it is working, copy it back to the production version at https://developer.mozilla.org/en-US/docs/Template:EmbedCompatTable


== wiki-compat-table.js ==
== wiki-compat-table.js ==
67

edits