Skip to content

Commit

Permalink
fix(i18n): update localization docs and js strings (#2325)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Mar 30, 2024
1 parent ae71a6a commit 2b059c6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions docs/source/contributing/localization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ Extraction
.. note:: The json keys should be sorted alphabetically. You can use `jsonabc <https://novicelab.org/jsonabc/>`__
to sort the keys.

.. attention:: Due to the integration with Crowdin, it is important to only add strings to the `en.json` file,
and to not modify any other language files. After the PR is merged, the translations can take place
on `CrowdIn <https://translate.lizardbyte.dev/>`__. Once the translations are complete, a PR will be made
to merge the translations into Sunshine.

- Use the string in a Vue component.
.. code-block:: html

Expand Down Expand Up @@ -101,3 +106,8 @@ Extraction
.. code-block:: bash
python ./scripts/_locale.py --compile
.. attention:: Due to the integration with Crowdin, it is important to not include any extracted or compiled files in
Pull Requests. The files are automatically generated and updated by the workflow. Once the PR is merged, the
translations can take place on `CrowdIn <https://translate.lizardbyte.dev/>`__. Once the translations are
complete, a PR will be made to merge the translations into Sunshine.
4 changes: 2 additions & 2 deletions src_assets/common/assets/web/pin.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ <h1 class="my-4">{{ $t('pin.pin_pairing') }}</h1>
if (response.status.toString().toLowerCase() === "true") {
document.querySelector(
"#status"
).innerHTML = `<div class="alert alert-success" role="alert">Success! Please check Moonlight to continue</div>`;
).innerHTML = `<div class="alert alert-success" role="alert">$t('pin.pair_success')</div>`;
document.querySelector("#pin-input").value = "";
} else {
document.querySelector(
"#status"
).innerHTML = `<div class="alert alert-danger" role="alert">Pairing Failed: Check if the PIN is typed correctly</div>`;
).innerHTML = `<div class="alert alert-danger" role="alert">$t('pin.pair_failure')</div>`;
}
});
});
Expand Down
2 changes: 2 additions & 0 deletions src_assets/common/assets/web/public/assets/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@
"success_msg": "Password has been changed successfully! This page will reload soon, your browser will ask you for the new credentials."
},
"pin": {
"pair_failure": "Pairing Failed: Check if the PIN is typed correctly",
"pair_success": "Success! Please check Moonlight to continue",
"pin_pairing": "PIN Pairing",
"send": "Send",
"warning_msg": "Make sure you have access to the client you are pairing with. This software can give total control to your computer, so be careful!"
Expand Down

0 comments on commit 2b059c6

Please sign in to comment.