nextcloud / android

📱 Nextcloud Android app
https://play.google.com/store/apps/details?id=com.nextcloud.client
GNU General Public License v2.0
4.25k stars 1.76k forks source link

Translation error (german) #7956

Open stefan-niedermann opened 3 years ago

stefan-niedermann commented 3 years ago

cc @rakekniven - sorry, didn't know how to properly notify you...

In the Nextcloud Android app click on the +-button.

"Neu erstellen Textdokument" looks wrong. Either

grafik

rakekniven commented 3 years ago

Hello @stefan-niedermann ,

no problems to mention me at GitHub.

Just did a quick search and have not been able to find given string at Transifex ...

Which version are you using? latest greatest?

Cheers

stefan-niedermann commented 3 years ago

3.14.1, i think it's the latest released version an F-Droid.

Maybe it's a concatenated string? ("Textdokument" could be a parameter)

AndyScherzinger commented 3 years ago

it is concatenated:

OCFileListBottomSheetDialog.java line ~114 ff.

creatorViewBinding.creatorName.setText(
                        String.format(fileActivity.getString(R.string.editor_placeholder),
                                      fileActivity.getString(R.string.create_new),
                                      creator.getName()));

with editor placeholder being

%1$s %2$s

So you can't you anything about this, looping in @tobiasKaminsky I think we could fix this be rather using a string with a single placeholder for the document type being created by the respective menu item so order of words can be language depended and be handled by the translator :)

So should be doable, but needs a code change

rakekniven commented 3 years ago

Concatenated strings are evil 👿

stefan-niedermann commented 3 years ago

Or just a colon : before the type of the document?

AndyScherzinger commented 3 years ago

Or just a colon : before the type of the document?

Nope that'll probably won't work for R-T-L languages

AndyScherzinger commented 3 years ago

... I guess

stefan-niedermann commented 3 years ago

Why not? the default string could be %1$s: %2$s and a translation of a R-T-L language can be %2$s :%1$s - though i think the browser Android should handle that still correctly :man_shrugging:

AndyScherzinger commented 3 years ago

ah, well %1$s %2$s is currently flagged as translatable=false which kind of makes sense this a pure placeholder file is impossible to translate with a description of the actual usage scenario :/ I still think a string with one placeholder solves the problem just fine and is easy to understand for the translators.

tobiasKaminsky commented 3 years ago

I think both approaches work, but having there a colon, when we have it nowhere else feels a bit off 2021-02-10-072647 2021-02-10-072545

(just for showing how it is handled with other filetypes)

So I would go with Andy's idea. Please use new string names, as otherwise it will create trouble with non-updated languages.

rakekniven commented 3 years ago

We have many many strings at Transifex like "Create new folder", "Create new foobar". Without using any placeholder.

Using more than one should be avoided for such strings.

Jm2c.

AndyScherzinger commented 3 years ago

Using more than one should be avoided for such strings.

Create new %1s

@rakekniven how do you deal with the thing in @tobiasKaminsky's screenshot e.g. table and document since:

English:

German

So a placeholder won't work and I can't say if this is even more complex in other languages...

rakekniven commented 3 years ago

Oh, forgot to edit my previous posting. Same thought as yours (👍 ) came to my mind. Please do not use any placeholder at all. Make single strings for each

rakekniven commented 3 years ago

@stefan-niedermann Ok for you?

stefan-niedermann commented 3 years ago

Fine for me 🙂

tobiasKaminsky commented 3 years ago

Please do not use any placeholder at all. Make single strings for each

* Create new document

* Create new spreadsheet

* Create new presentation

* ...

Unfortunately this does not work, as we get this directly via api, and e.g. text could add new templates and thus new "create text xyz" can appear.

I wonder why this is only happening on Android/german.

AndyScherzinger commented 3 years ago

@tobiasKaminsky it is probably happening on iOS too I guess and I would guess that the translation needs to be handled as described for the server-repo :)

tobiasKaminsky commented 3 years ago

@juliushaertl do you know how this is done on server side?

rakekniven commented 3 years ago

Not the same on iOS when using Only Office.

The app:

2021-02-15 16-54-36 3903

Transifex:

Bildschirmfoto 2021-02-17 um 13 41 00
tobiasKaminsky commented 3 years ago

@rakekniven is this OnlyOffice or Collabora?

AndyScherzinger commented 3 years ago

@tobiasKaminsky please see: https://github.com/nextcloud/android/blob/master/src/main/java/com/owncloud/android/ui/fragment/OCFileListBottomSheetDialog.java#L113-L116 we do not use these translations but build the strings via concatination

rakekniven commented 3 years ago

@rakekniven is this OnlyOffice or Collabora?

OnlyOffice

tobiasKaminsky commented 3 years ago

@tobiasKaminsky please see: https://github.com/nextcloud/android/blob/master/src/main/java/com/owncloud/android/ui/fragment/OCFileListBottomSheetDialog.java#L113-L116 we do not use these translations but build the strings via concatination

Right, this is what I said already:

Unfortunately this does not work, as we get this directly via api, and e.g. text could add new templates and thus new "create text xyz" can appear.

It is strange that on iOS with directEditing (so Text or OnlyOffice) they can use real strings. Found it: https://github.com/nextcloud/ios/blob/b57a6b8657b622c02d2d88417225334e9f2cbcd6/iOSClient/Main/Menu/AppDelegate%2BMenu.swift#L213

There it is hardcoded…

tobiasKaminsky commented 3 years ago

@juliushaertl can we add those info of directEditing directly in server response? Endpoint is:

/ocs/v2.php/apps/files/api/v1/directEditing

So that there is a new "text", which shows translated, e.g. "Neues Tabellendokument erstellen".

tobiasKaminsky commented 3 years ago

@AndyScherzinger I remember that we discussed in last design call, to remove this whole "create new", but only use the "names", e.g. Spreadsheet or Document.

This would also solve the problem, or?

AndyScherzinger commented 3 years ago

@tobiasKaminsky Yes that would solve it for the bottom sheet, but it might come back for the template selection screen, see latest template select dialog PR while we could solve it with a more generic dialog title then.

tobiasKaminsky commented 3 years ago

but it might come back for the template selection screen

Then server should provide us a good translation.

AndyScherzinger commented 3 years ago

Then server should provide us a good translation.

Absolutely 👍