osm-fr / osmose-frontend

Part of osmose that shows results on the website http://osmose.openstreetmap.fr
GNU General Public License v3.0
41 stars 38 forks source link

Fix English typos #451

Closed Famlam closed 1 year ago

Famlam commented 1 year ago

Fix some English typos (see also https://github.com/osm-fr/osmose-backend/issues/1731#issuecomment-1435965143 )

@jocelynj I don't think this will affect any non-English translations since they're just typos, so would it be possible to run your script once again to update them automatically? E.g. without deleting the existing translations?

Famlam commented 1 year ago

Just pinging on an old PR in case you missed it @jocelynj :)

jocelynj commented 1 year ago

I had missed this PR, sorry :)

I was able to find the script that I've launched on backend, here is a copy for reference, where osmose-backend.pot.old is the file before the branch, and osmose-backend.pot.new after. I will try to launch the script this week.

#! /usr/bin/env python3

import glob
import os
import polib

def detect_mod_strings():
  modified_string = {}

  pot_new = polib.pofile('osmose-backend.pot.new')
  pot_old = polib.pofile('osmose-backend.pot.old')

  for entryn in pot_new:
    for entryo in pot_old:
      if entryn.occurrences != [] and entryn.occurrences == entryo.occurrences and entryn.msgid != entryo.msgid:
        modified_string[entryo.msgid] = entryn.msgid

  return modified_string

def modify_file(modified_string, file):
  po = polib.pofile(file)
  num = 0
  for entry in po:
    if entry.msgid in modified_string:
      entry.msgid = modified_string[entry.msgid]
      num += 1
  print(file, "- modified", num, "entries")
  po.save(file)

if __name__ == "__main__":
  modified_string = detect_mod_strings()
  modify_file(modified_string, "osmose-backend.pot")
  for f in glob.glob("*.po"):
    modify_file(modified_string, f)
Famlam commented 1 year ago

Thank you :)

jocelynj commented 1 year ago

I should have updated the translated strings - can you check?

@frodrigo : I'm not sure why lint-python now fails on the branch, any idea?

Famlam commented 1 year ago

I should have updated the translated strings - can you check?

Thanks! Looks good to me (just curious why some authors are now listed twice, see e.g. web/po/es.po )

@frodrigo : I'm not sure why lint-python now fails on the branch, any idea?

I'm not Frodrigo, but it seems unrelated to this branch / your commit. The following PR by 'dependabot' also fails with the same: https://github.com/osm-fr/osmose-frontend/actions/runs/4424158708

frodrigo commented 1 year ago

@frodrigo : I'm not sure why lint-python now fails on the branch, any idea?

The rules are auto update (not fixed version, on purpose). So when we got new rules from upstream it fails.

frodrigo commented 1 year ago

I let you merge when it is ok for you.

jocelynj commented 1 year ago

just curious why some authors are now listed twice

I agree that it is a bit strange, but we can fix this later.

Thanks for the update on english strings - it should be easier next time :)