Mastodon translation JSON

Hello,
I am improving Mastodon translation and will eventually submit to Crowdin. Before that I want to test it. I have updated sr.json file in app/javascript/mastodon/locales. After restarting and clearing cache nothing changed except in https://mywebsite/@username
Version is 3.1.3 on DigitalOcean 1-Click Install
Any suggestions? Thanks in advance

Changing the translations under app/javascript/mastodon/locales requires you to run bundle exec rails assets:precompile before restarting mastodon-web.

1 Like

Hi Claire, thanks for a response.
Unfortunately it did not work for me. Installed new instance, changed *.json and applied your suggestion. No errors but no change. Tried everything. Maybe the reason is the fact DigitalOcean has outdated version of Mastodon 3.1.3
Or if you could tell me the exact steps, maybe I have missed something obvious.
All the best

Hmmm… your really should just have to edit the file, run “bundle exec rails assets:precompile” then (as root) systemctl reload mastodon-web.

However, if you’re editing translations, you should not work on 3.1.3, but on the latest development version (you can switch with git fetch && git checkout main then install dependencies with bundle install, migrate the database with bundle exec rails db:migrate, compile the assets with bundle exec rails assets:precompile and finally restart everything by doing, as root, systemctl restart mastodon-{web,sidekiq,streaming}).

3.1.3 is my only current option, I’m not that kind of a geek, just using DigitalOcean 1-Click only option. Except for the git part all other suggestions applied without success. Is there any information when will DigitalOcean update Mastodon droplet. I do not think I am capable of installing it by myself. (btw my site is dorijan.io)
Thank you once more for your effort and possible answers

Unfortunately, maintaining a Mastodon instance does require a bit of knowledge, in particular being able to follow the instructions on Upgrading to a new release - Mastodon documentation and the individual release notes.

what errors did you encounter?

I don’t know when or if the Mastodon DigitalOcean droplet will get updated.

Applied without success in terms that no change to the translation happened as well as mastodon version. I am at the server right now, fetched tags, should I checkout v3.4.3

Which are the correct steps afterwards

Because this is a backport, it is not available with git pull . Use git fetch && git checkout v3.4.2

As always, make sure you have backups of the database before performing any upgrades . If you are using docker-compose, this is how a backup command might look: docker exec mastodon_db_1 pg_dump -Fc -U postgres postgres > name_of_the_backup.dump

Non-Docker only:

  • Install dependencies: bundle install and yarn install

Both Docker and non-Docker:

  1. Run the database migrations:
  • Non-Docker: RAILS_ENV=production bundle exec rails db:migrate
  • Docker: docker-compose run --rm web rails db:migrate
  1. Precompile the assets:
  • Non-Docker: RAILS_ENV=production bundle exec rails assets:precompile
  • Docker: The assets are already precompiled during the build step
  1. Restart all Mastodon processes

For translations, you should be working on top of main and not a release, so you’d do git fetch && git checkout main.

Then, bundle install and yarn install, then run the following steps:

  1. RAILS_ENV=production bundle exec rails db:migrate
  2. RAILS_ENV=production bundle exec rails assets:precompile
  3. RAILS_ENV=production ./bin/tootctl cache clear
  4. (as root) systemctl restart mastodon-{web,sidekiq,streaming}
1 Like

root@mastodon:~# su - mastodon
mastodon@mastodon:~$ cd /home/mastodon/live/
mastodon@mastodon:~/live$ git fetch
remote: Enumerating objects: 511, done.
remote: Counting objects: 100% (339/339), done.
remote: Compressing objects: 100% (93/93), done.
remote: Total 209 (delta 146), reused 168 (delta 111), pack-reused 0
Receiving objects: 100% (209/209), 36.80 KiB | 18.40 MiB/s, done.
Resolving deltas: 100% (146/146), completed with 93 local objects.
From GitHub - mastodon/mastodon: Your self-hosted, globally interconnected microblogging community

  • 1ce8166ab…05103b366 feature-discover-trending-links → origin/feature-discover-trending-links (forced update)
    d06e4e6cb…c2b780a10 l10n_main → origin/l10n_main
    4b616c4f0…3517867b7 main → origin/main
    mastodon@mastodon:~/live$ git checkout main
    M app/javascript/images/logo_full.svg
    Previous HEAD position was 85f0e0a60 Update CHANGELOG.md (#13397)
    Branch ‘main’ set up to track remote branch ‘main’ from ‘origin’.
    Switched to a new branch ‘main’
    mastodon@mastodon:~/live$ bundle install
    rbenv: version `2.7.4’ is not installed (set by /home/mastodon/live/.ruby-version)
    mastodon@mastodon:~/live$

Sorry for the late reply. Try rbenv install 2.7.4

1 Like

Got myself a fresh v3.4.3, everything went like a charm. Tomorrow I will give translation a try and report. If it goes well we’ll recapitulate everything in one reply so others can make use of it… I suppose there are a few that have tried DigitalOcean 1-Click and got them in the situation like I did…

1 Like

These are exact steps for updating Mastodon and changing translation files

Edit *.json file in app/javascript/mastodon/locales

Then in console perform the following

su - mastodon
cd /home/mastodon/live
git fetch
git checkout main
git pull
git -C /home/mastodon/.rbenv/plugins/ruby-build pull
rbenv install --list
rbenv install 2.7.4 // or newer from list
bundle install
yarn install
RAILS_ENV=production bundle exec rails db:migrate
RAILS_ENV=production bundle exec rails assets:precompile
RAILS_ENV=production ./bin/tootctl cache clear
exit // to be root
systemctl restart mastodon-web
systemctl restart mastodon-sidekiq
systemctl restart mastodon-streaming

This procedure gives you up to date Mastodon version and your translation file active. You can eventually upload it to Crowdin…

Thank you Claire for your effort and time. Hope this will help others too.

1 Like
[4/6] Linking dependencies...
warning " > react-redux-loading-bar@4.0.8" has incorrect peer dependency "react-redux@^3.0.0 || ^4.0.0 || ^5.0.0".

Suddenly, hm…