geopaparazzi / smash

Source code of the SMASH Android/iOS digital field mapping app.
https://www.geopaparazzi.org/smash/index.html
GNU General Public License v3.0
70 stars 25 forks source link

Hosted Weblate Japanese language conflicts alert #198

Open sanak opened 1 year ago

sanak commented 1 year ago

Hosted Weblate alerts following Japanese language conflicts today. https://hosted.weblate.org/projects/smash/smash-main-app/#alerts

Weblate could not merge upstream changes while updating the repository.

Rebasing (1/1)
error: could not apply 0e8fe69... Translated using Weblate (Japanese)
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 0e8fe69... Translated using Weblate (Japanese)
Auto-merging lib/l10n/intl_ja.arb
CONFLICT (content): Merge conflict in lib/l10n/intl_ja.arb
 (1)

Typical workflow for fixing merge conflicts

  1. Commit all pending changes in Weblate and lock the translation component. wlc commit; wlc lock
  2. Add Weblate exported repository as a remote. git remote add weblate https://hosted.weblate.org/git/smash/smash-main-app/ ; git remote update weblate
  3. Merge Weblate changes and resolve any conflicts. git merge weblate/main
  4. Push changes into upstream repository. git push origin main
  5. Weblate should now be able to see updated repository and you can unlock it. wlc pull ; wlc unlock

Check the FAQ for info on how to resolve this.

sanak commented 1 year ago

I tried the following on my local environment and could reproduce the same error message.

% git checkout master
% git pull
% git remote add weblate https://hosted.weblate.org/git/smash/smash-main-app/
% git remote update weblate
% git merge weblate/master
Auto-merging lib/l10n/intl_ja.arb
CONFLICT (content): Merge conflict in lib/l10n/intl_ja.arb
Automatic merge failed; fix conflicts and then commit the result.

The conflicts diff was as follows, so I guess that updating Weblate git is necessary related with PR:https://github.com/geopaparazzi/smash/pull/193.

conflicts diff ```diff --- a/lib/l10n/intl_ja.arb +++ b/lib/l10n/intl_ja.arb @@@ -98,6 -98,64 +98,67 @@@ "@mainviewUtils_sharePosition": {}, "mainviewUtils_rotateMapWithGps": "GPSで地図を回転", "@mainviewUtils_rotateMapWithGps": {}, ++<<<<<<< HEAD ++======= + "exportWidget_export": "エクスポート", + "@exportWidget_export": {}, + "exportWidget_pdfExported": "PDFエクスポート済み", + "@exportWidget_pdfExported": {}, + "exportWidget_exportToPortableDocumentFormat": "プロジェクトをPDF形式にエクスポート", + "@exportWidget_exportToPortableDocumentFormat": {}, + "exportWidget_gpxExported": "GPXエクスポート済み", + "@exportWidget_gpxExported": {}, + "exportWidget_exportToGpx": "プロジェクトをGPXにエクスポート", + "@exportWidget_exportToGpx": {}, + "exportWidget_kmlExported": "KMLエクスポート済み", + "@exportWidget_kmlExported": {}, + "exportWidget_exportToKml": "プロジェクトをKMLにエクスポート", + "@exportWidget_exportToKml": {}, + "exportWidget_geopackageExported": "GeoPackageエクスポート済み", + "@exportWidget_geopackageExported": {}, + "exportWidget_exportToGeopackage": "プロジェクトをGeoPackageにエクスポート", + "@exportWidget_exportToGeopackage": {}, + "exportWidget_exportToGSS": "Geopaparazzi Survey Serverにエクスポート", + "@exportWidget_exportToGSS": {}, + "gssExport_gssExport": "GSSエクスポート", + "@gssExport_gssExport": {}, + "gssExport_setProjectDirty": "プロジェクトをダーティに設定しますか?", + "@gssExport_setProjectDirty": {}, + "gssExport_thisCantBeUndone": "これは元に戻せません!", + "@gssExport_thisCantBeUndone": {}, + "gssExport_restoreProjectAsDirty": "プロジェクトをすべてダーティとして復元します。", + "@gssExport_restoreProjectAsDirty": {}, + "gssExport_setProjectClean": "プロジェクトをクリーンに設定しますか?", + "@gssExport_setProjectClean": {}, + "gssExport_restoreProjectAsClean": "プロジェクトをすべてクリーンな状態で復元します。", + "@gssExport_restoreProjectAsClean": {}, + "gssExport_nothingToSync": "同期するものがありません。", + "@gssExport_nothingToSync": {}, + "gssExport_collectingSyncStats": "同期統計を収集しています…", + "@gssExport_collectingSyncStats": {}, + "gssExport_unableToSyncDueToError": "エラーのため同期できません。診断を確認してください。", + "@gssExport_unableToSyncDueToError": {}, + "gssExport_noGssUrlSet": "GSSサーバーのURLが設定されていません。設定を確認してください。", + "@gssExport_noGssUrlSet": {}, + "gssExport_noGssPasswordSet": "GSSサーバーのパスワードが設定されていません。設定を確認してください。", + "@gssExport_noGssPasswordSet": {}, + "gssExport_synStats": "同期統計", + "@gssExport_synStats": {}, + "gssExport_followingDataWillBeUploaded": "次のデータは同期時にアップロードされます。", + "@gssExport_followingDataWillBeUploaded": {}, + "gssExport_gpsLogs": "GPSログ:", + "@gssExport_gpsLogs": {}, + "gssExport_simpleNotes": "シンプルノート:", + "@gssExport_simpleNotes": {}, + "gssExport_formNotes": "フォームノート:", + "@gssExport_formNotes": {}, + "gssExport_images": "画像:", + "@gssExport_images": {}, + "gssExport_shouldNotHappen": "発生してはならない", + "@gssExport_shouldNotHappen": {}, + "gssExport_upload": "アップロード", + "@gssExport_upload": {}, ++>>>>>>> weblate/master "geocoding_geocoding": "ジオコーディング", "@geocoding_geocoding": {}, "geocoding_nothingToLookFor": "検索するものがありません。アドレスを挿入してください。", @@@ -116,6 -174,40 +177,43 @@@ "@gps_smashLocServiceIsActive": {}, "gps_backgroundLocIsOnToKeepRegistering": "アプリがバックグラウンドにある場合でも、アプリが位置情報を登録し続けるために、バックグラウンドロケーションがオンにな っています。", "@gps_backgroundLocIsOnToKeepRegistering": {}, ++<<<<<<< HEAD ++======= + "gssImport_gssImport": "GSSインポート", + "@gssImport_gssImport": {}, + "gssImport_downloadingDataList": "データリストをダウンロードしています…", + "@gssImport_downloadingDataList": {}, + "gssImport_unableDownloadDataList": "エラーのため、データリストをダウンロードできません。設定とログを確認してください。", + "@gssImport_unableDownloadDataList": {}, + "gssImport_noGssUrlSet": "GSSサーバーのURLが設定されていません。設定を確認してください。", + "@gssImport_noGssUrlSet": {}, + "gssImport_noGssPasswordSet": "GSSサーバーのパスワードが設定されていません。設定を確認してください。", + "@gssImport_noGssPasswordSet": {}, + "gssImport_noPermToAccessServer": "サーバーにアクセスする権限がありません。資格情報を確認してください。", + "@gssImport_noPermToAccessServer": {}, + "gssImport_data": "データ", + "@gssImport_data": {}, + "gssImport_dataSetsDownloadedMapsFolder": "データセットはマップフォルダーにダウンロードされます。", + "@gssImport_dataSetsDownloadedMapsFolder": {}, + "gssImport_noDataAvailable": "利用可能なデータがありません。", + "@gssImport_noDataAvailable": {}, + "gssImport_projects": "プロジェクト", + "@gssImport_projects": {}, + "gssImport_projectsDownloadedProjectFolder": "プロジェクトはプロジェクトフォルダーにダウンロードされます。", + "@gssImport_projectsDownloadedProjectFolder": {}, + "gssImport_noProjectsAvailable": "利用可能なプロジェクトがありません。", + "@gssImport_noProjectsAvailable": {}, + "gssImport_forms": "フォーム", + "@gssImport_forms": {}, + "gssImport_tagsDownloadedFormsFolder": "タグファイルはフォームフォルダーにダウンロードされます。", + "@gssImport_tagsDownloadedFormsFolder": {}, + "gssImport_noTagsAvailable": "使用可能なタグはありません。", + "@gssImport_noTagsAvailable": {}, + "importWidget_import": "インポート", + "@importWidget_import": {}, + "importWidget_importFromGeopaparazzi": "Geopaparazzi Survey Serverからインポート", + "@importWidget_importFromGeopaparazzi": {}, ++>>>>>>> weblate/master "layersView_layerList": "レイヤーリスト", "@layersView_layerList": {}, "layersView_loadRemoteDatabase": "リモートデータベースをロード", ```
moovida commented 1 year ago

Hi @sanak , I am not sure why this happened. Maybe because we removed some entries? Should we do that on weblate in future? Not sure.

sanak commented 1 year ago

Hi @moovida, (CC: @dkastl, @mbasa)

Maybe because we removed some entries? Should we do that on weblate in future?

I guess so.

Is it possible for you to update Hosted Weblate git master branch from GitHub master branch by force push ?

I guess that Hosted Weblate project/components admin privilege and Weblate Client commit/lock and pull/unlock operation may be necessary.

moovida commented 1 year ago

@sanak , you mean following the above workflow, right? Ok, I will try before leaving. Fingers crossed.

moovida commented 1 year ago

I am getting issues here when issuing: git remote update weblate

Fetching weblate
warning: no common commits
remote: Enumerating objects: 1208, done.
remote: Counting objects: 100% (1208/1208), done.
remote: Compressing objects: 100% (666/666), done.
remote: Total 1208 (delta 649), reused 859 (delta 447), pack-reused 0
Receiving objects: 100% (1208/1208), 5.54 MiB | 4.60 MiB/s, done.
Resolving deltas: 100% (649/649), done.
error: Could not read e2b99061bcbfcb04f801fa6daabb309994c78975
fatal: revision walk setup failed
error: https://hosted.weblate.org/git/smash/smash-main-app/ did not send all necessary objects

error: Could not fetch weblate

Testing this on the plugins project.

sanak commented 1 year ago

@sanak , you mean following the above workflow, right?

Well, my suggestion was opposite direction (GitHub => Weblate), but Weblate suggested workflow (Weblate => GitHub) is also okay and probably more safe. (But, I guess that latter way requires every languages conflicts, later.)

And okay about the above git remote update weblate error...

moovida commented 1 year ago

Was able to add api key to the config. But I am still not getting anything from the wlc commands.

~/development/SMASH/smash_import_export_plugins >>> wlc commit
Error: No object passed on command line!
sanak commented 1 year ago

Okay, I will try wlc on my local environment, once. (I guess that wlc fetch operation should work with my account.) https://docs.weblate.org/en/latest/wlc.html#getting-started

sanak commented 1 year ago

@moovida I guess that wlc commit or other wlc command requires translation project/component, so could you try the following once ?

wlc commit smash/smash-import-export-plugins

(On my local environment, it returns the following message, but I guess that it comes from my account's role.)

% wlc commit smash/smash-import-export-plugins
Error: Object not found on the server (maybe operation is not supported on the server)
sanak commented 1 year ago

By the way, I found the following past weblate issue, and deleting translation key may be better to be done via web interface with Cleanup addon... https://github.com/WeblateOrg/weblate/issues/1974

Deleting existing translation seems to require Administration or Manage languages role (from https://docs.weblate.org/en/latest/admin/access.html#list-of-privileges-and-built-in-roles), so I can't try it, but just for information...

moovida commented 1 year ago

@sanak since our last git conflict (which you solved), I continuously have generated language files that result modified in my workspace:

        modified:   lib/generated/l10n.dart
        modified:   lib/generated/l10n_cs.dart
        modified:   lib/generated/l10n_de.dart
        modified:   lib/generated/l10n_en.dart
        modified:   lib/generated/l10n_fr.dart
        modified:   lib/generated/l10n_it.dart
        modified:   lib/generated/l10n_ja.dart
        modified:   lib/generated/l10n_nb.dart
        modified:   lib/generated/l10n_ru.dart

Since I do not want to create trouble, I need to be sure. These should be removed from git and be placed into git ignore, right?

sanak commented 1 year ago

@moovida Oh, yes. The generated intl files can be removed from git and ignoring those by git ignore is possible.

If deleting output-dir: lib/generated line from l10n.yaml, then intl files will be generated in ./.dart_tool/flutter_gen/gen_l10n, but it is a bit hard to remember, so keeping current output-dir: lib/generated line will be good.

But about import/export plugins side, it may be good to include generated intl files to simplify smash side build process.