tassoman
(Tassoman)
October 27, 2020, 3:34pm
1
Ciao,
I’m trying to file a pull request for updating translations page on developers documentation website.
The summary (Matomo 4.X dropdown menu version) claims:
how to make your contribution to Matomo (formerly Piwik) Core available in other languages**
When I click «Edit on Github» i get to
---
category: Develop
---
# Translations
Read this guide if you'd like to know
- **how to make your plugin available in other languages**
- **how to make your contribution to Matomo Core available in other languages**
## The Basics
Matomo is available in over 50 languages and comes with many translations. The core itself provides some basic translations for words like "Visitor" and "Help". They are stored in the directory <code>/lang</code>. In addition, each plugin can provide its own translations for wordings that are used in this plugin. They are located in <code>/plugins/\*/lang</code>. In those directories you'll find one JSON file for each language. Each language file consists in turn of tokens that belong to a group. Every language that has a file in the main `/lang` directory can be selected by Matomo users.
```json
{
"MyPlugin": {
"BlogPost": "Blog post",
"MyToken": "My translation",
This file has been truncated. show original
This is correct, but the summary claims (live branch):
how to make your contribution to Piwik Core available in other languages**
I’m confused.
tassoman
(Tassoman)
October 27, 2020, 3:38pm
2
Did you set a deploy script replacing the word [space]Piwik[Space] with Matomo (formerly Piwik) by regex?
SteveG
(Stefan Giehl)
October 27, 2020, 4:21pm
3
Afaik it’s replace automatically. Guess it would have been too much work to replace that everywhere manually.
Lukas
(Lukas Winkler)
October 27, 2020, 4:36pm
4
It would be great if we could replace that script one day with editing all files.
There are still I think a few cases where it breaks the code by replacing the Piwik::
class.
tassoman
(Tassoman)
October 27, 2020, 7:00pm
5
Ok thanks! Much clear now I was going crazy lol!
In the next hours I push my fixes in the documentation.
In my opinion using a Regex parsing with a “per file” supervision, inside an IDE (vscode?) should be enough effort.
In most cases, something like “\sPiwik(,|.|.\s)?\s” would match, look at this example