LonamiWebs / Stringlate

Android application to help in strings.xml translation
https://lonamiwebs.github.io/stringlate/index
MIT License
106 stars 48 forks source link

Implement some safeguards #42

Open licaon-kter opened 7 years ago

licaon-kter commented 7 years ago

Not an urgent issue.

By safeguards I mean having the app inform the user that they might have missed something, eg: end dot, exclamation mark at the end, question mark at the end.

Yes, this can get tricky (if you have them inside the string too), but at least the ones mentioned above look simpler.

Lonami commented 7 years ago

And also replacing "..." (three dots) by "…" (ellipsis), or things like " ," by ", ".

Perhaps this could be done if and only if the original string has the dot at the end, for example? What about other languages? For example, Spanish uses "¿" and "¡", but it doesn't have to be necessarily at the start of the string. Maybe anywhere in the middle.

licaon-kter commented 7 years ago

if and only if the original string has

Yes, that's a must, again if you put a dot at the end and the original string does not have it, then that needs to be signaled "hey, the original string has/does not have X, are you sure you want to save without?"

Not enforce anything (between you and me, those dots at the end look random to me, each project maintainer has its way with them), but signal if not consistent.

Lonami commented 7 years ago

"hey, the original string has/does not have X, are you sure you want to save without?"

(eg. Stringlate has >110 OMFG!)

:+1:

Jokes out, maybe some TextView in an orange-like color as a warning would be nice.

licaon-kter commented 7 years ago

Umm, that would need some help text anyway, in the Wiki/offline help.

Buuuuttttt, you can add some info:

The red triangle of error I have seen in login screens somewhere, when you enter a bad password, not sure it's a simple thing in Android.

Lonami commented 7 years ago

cough multiline

I need to look at why the XmlPullParser is not reading the multiline. It probably trims the text, and merges ≥ 2 spaces into one.

The red triangle of error I have seen in login screens somewhere, when you enter a bad password, not sure it's a simple thing in Android.

Yep, it's simple. But I don't know if it's only for errors or also warnings. Although it shouldn't make a difference since I don't really validate anything when updating the translation.

licaon-kter commented 7 years ago

That ellipsis fits here. :)

Lonami commented 7 years ago

That ellipsis fits here.

But most keyboards don't bring this, and if they do (AnySoftKeyboard does), people won't necessarily be using it. However, perhaps aggressively replacing automatically is not an option. An "Apply suggested fix" button maybe?

licaon-kter commented 7 years ago

If the fix is signaled (eg: orange text) then yes!

Lonami commented 7 years ago

Trying to think how this could fit into the UI. How about the "linter" running right when you try to change to another string, if it finds anything it should warn you about, then it saves your action ("Next", "Previous", whatever), hides the prev/save/next buttons and instead shows "Cancel", "Apply fix" and "Dismiss". Above these new buttons some warning icon and a text hinting what should be done.

Edit: Also, besides missing ?, ! and ., do you know any other? I can't think of any right now.

licaon-kter commented 7 years ago

Not sure what lint checks apply here.

Another issue is letter case, eg: start of text or in the middle after a dot

Lonami commented 7 years ago

Not sure what lint checks apply here.

To be honest I don't think I understand what a linter is. I thought it was something that checked for common issues or mistakes like variables being unused or the access modifier being lower? Anyway, just a fancy word for the "guard" class.

Lonami commented 7 years ago

Probably consider this for French too.

mquinson commented 7 years ago

This editor implements a lot of such verification. You could maybe reuse some code here? https://github.com/vslavik/poedit

Lonami commented 7 years ago

I've never worked with poedit before so I don't know how its verification works, and neither where I should look for such checks 😅 But maybe it's something to take into account thanks @mquinson

gsantner commented 6 years ago

Seems harder to get into poedit's code rather than writing this things new in java :D

mquinson commented 6 years ago

That's very possible, I never looked at the source code of poedit. If so, maybe you could use poedit code as a list of checks to reimplement in stringlate?

gsantner commented 6 years ago

As translator always helpful :D. Feel free to start contributing too 😄