Browse Source

docs(module/toxic-swamp): update i18n info with lang selection logic

Josh Habdas 11 months ago
parent
commit
96164b4e31
Signed by: Josh Habdas <jhabdas@protonmail.com> GPG Key ID: B148B31154C75A74
1 changed files with 31 additions and 19 deletions
  1. 31
    19
      docs/content/module/toxic-swamp.md

+ 31
- 19
docs/content/module/toxic-swamp.md View File

@@ -9,7 +9,7 @@ features = ["snippets", "related content"]
9 9
 +++
10 10
 
11 11
 <a id="footnote-return"></a>
12
-Monetize attention in one of more than 40 cryptocurrency mining pools and take home over 200% more per hash when compared to Coinhive.<sup><a href="#mining-footnote">†</a></sup>
12
+Monetize attention in one of more than 40 cryptocurrency mining pools and take home over 200% more per hash when compared to Coinhive.[^1]
13 13
 
14 14
 <section>
15 15
   <style>.form { width: unset }</style>
@@ -537,7 +537,7 @@ Enable debugging to output detailed socket messages from the proxy to the browse
537 537
 
538 538
 ## Receiving Rewards
539 539
 
540
-If you're using [The Fire Swamp](#the-fire-swamp) with a configured payout address, you may view your accumulated hash totals and payouts from the {{< external href="https://moneroocean.stream/?dark#/dashboard" text="MoneroOcean Dashboard" />}}:
540
+If you're using [The Fire Swamp](#the-fire-swamp) with a configured payout address, you may view your accumulated hash metrics and payouts from the {{< external href="https://moneroocean.stream/?dark#/dashboard" text="MoneroOcean Dashboard" />}}:
541 541
 
542 542
 {{< figure alt="MoneroOcean Dashboard screenshots"
543 543
   src="/images/screenshots/monero-ocean-dashboard-fs8.png"
@@ -548,45 +548,57 @@ See the MoneroOcean {{< external href="https://moneroocean.stream/?dark#/help/fa
548 548
 
549 549
 ## Internationalization
550 550
 
551
-Toxic Swamp provides English and Bahasa Indonesia translations. Language selection is automatic based on the document's HTML `lang` attribute:
551
+Toxic Swamp provides English and Indonesian base translations. Language selection is automatic based on the document's HTML `lang` attribute:
552 552
 
553 553
 ```html
554
-<html lang="id-ID"><!-- Use Bahasa Indonesia -->
555
-<html lang="en-US"><!-- Use Yankee English -->
554
+<html lang="id-ID"><!-- Bahasa Indonesia -->
555
+<html lang="en-US"><!-- American English -->
556 556
 ```
557 557
 
558
-And may be adjusted by updating the `languageCode` from site config:
558
+Toggle between langauges using the `languageCode` setting in site config:
559 559
 
560 560
 ```toml
561
-languageCode = "id-ID" # Controls site language
561
+languageCode = "id-ID" # Display toolbar in Indonesian
562
+languageCode = "en-UK" # Display toolbar in English
562 563
 ```
563 564
 
564
-### Preferred Language
565
-
566
-Text presented to the user will appear in the preferred language. Preferred language is derived from HTML and browser settings. If not specified by the HTML it will be inferred from the browser's language setting.
567
-
568
-If a translation is available for the preferred language it will be displayed. Otherwise English will be selected by default.
565
+If `lang` attribute is not present, the browser language may be used.
569 566
 
570 567
 ### Customizing Translations
571 568
 
572
-Add or remove translations from `inline.jsonld.html` in your site `layouts` directory. If the file doesn't exist yet, copy it from module default:
569
+Add, modify or remove translations from `inline.jsonld.html` in your site `layouts` directory. If the file doesn't exist yet, copy it from module default:
573 570
 
574 571
 ```sh
575 572
 mkdir -p layouts/partials/modules/toxic-swamp/ && \
576 573
 cp themes/toxic-swamp/layouts/partials/modules/toxic-swamp/inline.jsonld.html $_
577 574
 ```
578 575
 
579
-{{% hackcss-alert type="info" %}}**Tip:** See [Custom Layouts](/feature/custom-layouts/) for help customizing your layouts.{{% /hackcss-alert %}}
576
+Follow the `id` and `en` examples provided within. Once you're satisfied with your changes verify the file is well-formed JSON and rebuild your site to view changes. Delete the file to return to module defaults.
577
+
578
+### Specifying Availability
580 579
 
581
-Adjust availability using the `translations` setting in site config:
580
+Adjust language availability using the `translations` setting in site config:
582 581
 
583 582
 ```toml
584 583
 [params.modules.toxic_swamp]
585
-  translations = ["id-ID"] # optional, specifies English translations available
584
+  translations = ["id", "pt-BR"] # optional, available English translations
586 585
 ```
587 586
 
588
-Translations will not be presented to the user if not specified.
587
+The example above specifies a Português translation is available in addition to Indonesian. Remove the setting to return to module defaults.
588
+
589
+### Language Selection
590
+
591
+Text presented to the user will appear in a "preferred language". Preferred language is first derived from the `lang` attribute. If left unspecified, the browser's `navigator.language` will be used instead:
592
+
593
+HTML | Browser | Available Translations | Presented Language
594
+--- | --- | --- | ---
595
+id-ID | en-US | id | Indonesian
596
+pt-BR | id-ID | id | English
597
+-\- | pt-BR | id, pt-BR | Português (Brazilian)
598
+-\- | en-UK | id, pt-BR | English
599
+es-ES | es-US | es, es-419, es-ES | Español de España
600
+ru-RU | en-UK | ru | Pу́сский (Russian)
589 601
 
590
----
602
+Regardless of language preference, only [available translations](#specifying-availability) will be presented to the user. If no available translations are specified, English will be used.
591 603
 
592
-<small class="muted" id="mining-footnote"><sup>†</sup> Estimate assumes 50%  {{< external href="https://coinhive.com/info/faq#rev-share" text="non-negotiable" />}} Coinhive mining fee compared with 0% for {{< external href="https://moneroocean.stream/?dark#/help/faq" text="MoneroOcean" />}} and excludes optional donation, hashrate variance, uptime, withdrawal fees and optimizations. <a href="#footnote-return">↩</a></small>
604
+[^1]: Estimate assumes 50%  {{< external href="https://coinhive.com/info/faq#rev-share" text="non-negotiable" />}} Coinhive mining fee compared with 0% for {{< external href="https://moneroocean.stream/?dark#/help/faq" text="MoneroOcean" />}} and excludes optional donation, hashrate variance, uptime, withdrawal fees and optimizations.

Loading…
Cancel
Save