Patchwork: add translations for missing strings

Created on 18 Oct 2017  ·  11Comments  ·  Source: ssbc/patchwork

Not sure what the best way of handling this is going forwards, but thought this time I'd just create an issue mentioning that there are a bunch of new strings to translate (in regards to blocking and distance warnings).

If you pull down the latest code, and then switch to the particular language, the new strings will automatically be added to the locale file. It's just a matter of going through and putting in the appropriate translations.

Some of the new translation strings are using substitutions and pluralization. For example

    "You share %s mutual friends with this person.": {
        "one": "You share %s mutual friend with this person.",
        "other": "You share %s mutual friends with this person."
    },

The %s will be replaced with the number of mutual friends. The one string will be used when the value is 1 and other used for all other numbers.

Will be pushing out a new release in the next day or so. Would be great to get the updated translations in there too!


  • [x] de (@cryptix)
  • [ ] es (@gmarcos87)
  • [ ] ki (@dangerousbeans)
  • [ ] pt (@ktorn)
  • [ ] pt-BR (@stackchain)

If you have commit access to patchwork (most of you do), feel free to commit the updated translations directly to master and tick off completion on this post!

Thanks heaps everyone ❤️

stale i18n

All 11 comments

I have this script, adapted from another project I'm working on. Just look for the differences between the languages ​​and the content of ./locales/en.json (assuming it is the one that is always complete).
It helps identify what is left over and missing in each case. I simply put it in the root and run node i18n-diff.js

You need the colors library to print to the terminal (npm install colors)

Terminal output

@gmarcos87 thanks for the script!

I adapted it a bit and then added it to patchwork.

npm run check-locales

It now outputs a copy-pastable format that you can put directly into the translation file (it includes the current english translation) and edit accordingly. This makes it easier to do the plural translations (and other complex ones in the future).

Hey @cryptix, @gmarcos87 and @stackchain, can you pull the latest version and run npm run check-locales and update the translations when you get a chance? I've added a few strings since last time.

I don't think creating issues is a sustainable way of managing these translations.

I should make a travis-ci task that counts the number of missing translations and displays them on the patchwork readme!

I was thinking about a translation system based on ssb. It could be useful
for other applications besides patchwork. Decent internationalization.
I would like to propose it for a grant for May or July.

What do you think?

@gmarcos87 you might want to talk to @clehner about this.. I think he already made something like this for patchwork-classic. Might be worthwhile to revive!

There are some more strings to translate, if anyone wants to!

@cryptix @gmarcos87 @ktorn @stackchain @dangerousbeans

Pull the latest code, npm install

And then run npm run check-locales.

You will get a list of strings that still need updating (with the current english translations). Copy the output for the given language into the file, and update the strings. Feel free to push to master if you have access.

Done! 😃

Not sure if y'all know about these things already, but FWIW, on Loomio we have a huge community of translation volunteers keeping the app up to date in many languages. We use Transifex, which is a community management platform for volunteers who want to translate software without having any code-related skills. Free for FLOSS users.

I'll add Slovak translation as I mentioned in @hGmbTAtbEMG2e151fikzBpzFpn0khgWeqA6krDvvhSc=.ed25519

Should I also create an issue or just a PR?

@Zaijo Just a PR is fine 😃

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

molstrangler picture molstrangler  ·  7Comments

Logicbloke picture Logicbloke  ·  7Comments

geovanisouza92 picture geovanisouza92  ·  3Comments

Gaffen picture Gaffen  ·  4Comments

skippednote picture skippednote  ·  6Comments