Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n: Merge Transifex translations #2942

Merged
merged 5 commits into from May 1, 2023

Conversation

HuidaeCho
Copy link
Member

@HuidaeCho HuidaeCho commented Apr 29, 2023

This PR merges additional translations from Transifex. The merging process was approximately as follows:

# install new tx CLI
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash

# move to the grass repo
cd .../grass

# create a new branch
git checkout -B transifex_final_merge

cd locale
# new tx seems to require file_filter and just overwrites
# PO files in place; make a backup copy of PO files
cp -a po po.bak
# pull Transifex translations into locale/po/*
tx pull -a -f
# move Transifex translations to transifex/.tx
mv po/* transifex/.tx
# restore the PO backup files
rmdir po
mv po.bak po

# recreate the old transifex/.tx folder structure
(
cd transifex/.tx

mkdir grass7.grasslibspot
for i in grasslibs_*; do
  j=`echo $i | sed 's/grasslibs_//; s/\.po/_translation/'`
  mv $i grass7.grasslibspot/$j
done

mkdir grass7.grassmodspot
for i in grassmods_*; do
  j=`echo $i | sed 's/grassmods_//; s/\.po/_translation/'`
  mv $i grass7.grassmodspot/$j
done

mkdir grass7.grasswxpypot
for i in grasswxpy_*; do
  j=`echo $i | sed 's/grasswxpy_//; s/\.po/_translation/'`
  mv $i grass7.grasswxpypot/$j
done
)

# use this modified version of transifex_merge.sh;
# only does msgcat
transifex/transifex_merge_2.sh

# check for new translations; here, we ignore any files
# that have only line-wrapping changes without new
# translations
#(
#cd po
#for i in *.po; do
#  # if there are any changes in msgstr, keep them
#  if git diff $i | grep -q '^[-+]msgstr\(\|\[[0-9]*\]\) "[^"]'; then
#    echo "$i: New translations found"
#  else # otherwise, copy back old PO file
#    echo "$i: No new translations"
#    cp ../po.bak/$i .
#  fi
#done
#)

# clean up
rm -rf po.bak

@HuidaeCho HuidaeCho added the translation Message translation related label Apr 29, 2023
@HuidaeCho HuidaeCho requested a review from neteler April 29, 2023 04:54
@HuidaeCho
Copy link
Member Author

I might have missed

msgstr ""
"new translation"

Maybe, we should skip the last "check for new translations"?

@neteler
Copy link
Member

neteler commented Apr 29, 2023

I might have missed

msgstr ""
"new translation"

Maybe, we should skip the last "check for new translations"?

The problem you mention isn't clear to me.

But the po files look good, thanks for your work.

After merge, weblate will simply update from GitHub and then we continue from there and close our transifex project?

@HuidaeCho
Copy link
Member Author

I might have missed

msgstr ""
"new translation"

Maybe, we should skip the last "check for new translations"?

The problem you mention isn't clear to me.

My script above overwrote any merged PO files with the current PO if they don't have any new translation from Transifex to avoid unnecessary commits. This check is simply see if there are any +msgstr "..." or -msgstr "...". If there were

+msgstr ""
+"new translation"

we missed it. A simple solution would be to skip this check and commit everything even including those same msgstr with simply different line wrapping. Then, we would see a lot of false changes. I think this latter method should be preferred if Weblate can handle massive line-wrapping-only changes.

But the po files look good, thanks for your work.

After merge, weblate will simply update from GitHub and then we continue from there and close our transifex project?

At least, that's my plan if everything goes smoothly.

@neteler
Copy link
Member

neteler commented Apr 29, 2023

A simple solution would be to skip this check and commit everything even including those same msgstr with simply different line wrapping. Then, we would see a lot of false changes. I think this latter method should be preferred if Weblate can handle massive line-wrapping-only changes.

Let's go for this. If Weblate rejects it we may go for the other way.

@HuidaeCho HuidaeCho merged commit 9a0da8b into OSGeo:main May 1, 2023
20 of 21 checks passed
@HuidaeCho HuidaeCho deleted the transifex_final_merge branch June 5, 2023 03:38
@neteler neteler added this to the 8.4.0 milestone Aug 16, 2023
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
* i18n: Merge Transifex translations

* Add transifex_merge_2.sh

* msgcat without checking msgstr "new translation"

* Resync with Weblate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
translation Message translation related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants