Skip to content

Commit bc511fe

Browse files
committed
fixup! fixup! feat(l10n): Improve translation guidelines
1 parent 8ec837f commit bc511fe

File tree

1 file changed

+8
-8
lines changed
  • developer_manual/basics/front-end

1 file changed

+8
-8
lines changed

developer_manual/basics/front-end/l10n.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Translation
77
Nextcloud provides mechanisms for internationalization (make an application translatable) and localization (add translations for specific languages). This section provides detailed instructions for both aspects.
88
In order to make your app translatable (internationalization), you should use Nextcloud's methods for translating strings. They are available for both the server-side (PHP, Templates) as well as for the client-side (JavaScript).
99

10-
PHP
11-
---
10+
PHP Backend
11+
-----------
1212

1313
If localized strings are used in the backend code, simply inject the ``\OCP\IL10N`` class into your service via type hinting it in the constructor. You will automatically get the language object containing the translations of your app:
1414

@@ -105,8 +105,8 @@ the ``force_language`` and ``default_language`` configuration options to conside
105105
}
106106
107107
108-
Templates
109-
---------
108+
PHP Templates
109+
-------------
110110

111111
In every template the global variable ``$l`` can be used to translate the strings using its methods ``t()`` and ``n()``:
112112

@@ -121,8 +121,8 @@ In every template the global variable ``$l`` can be used to translate the string
121121
// Date string
122122
<em><?php p($l->l('date', time())); ?></em>
123123
124-
JavaScript
125-
----------
124+
JavaScript / Typescript / Vue
125+
-----------------------------
126126

127127
There are global functions ``t()`` and ``n()`` available for translating strings in javascript code.
128128
If your app is build, you can import the translation functions from the `@nextcloud/l10n package <https://github.com/nextcloud-libraries/nextcloud-l10n>`_.
@@ -234,7 +234,7 @@ This allows translators to have the cloudlink before the browselink in case the
234234
.. _Hints:
235235

236236
Provide context hints for translators
237-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
237+
-------------------------------------
238238

239239
In case some translation strings may be translated wrongly because they have multiple meanings, you can add hints which will be shown in the Transifex web-interface:
240240

@@ -251,7 +251,7 @@ In case some translation strings may be translated wrongly because they have mul
251251
</li>
252252
</ul>
253253
254-
**Javascript**
254+
**Javascript / Typescript**
255255

256256
.. code-block:: javascript
257257

0 commit comments

Comments
 (0)