-
Notifications
You must be signed in to change notification settings - Fork 17
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
Tests for translations #608
Comments
Note: core has a test that switches language to Russian and checks. It will be "easy enough" to do similar checks in apps, at least of a few sample strings which demonstrate that the translation infrastructure is working. But to cover every place that has a string to be translated is not "easy" and not maintainable - translators can update the translation at any moment. |
Is the text of API responses translated? We could change the system language to Deutsch and check some API responses to see that they are translated. The current translation of those is unlikely to change, so the tests will not get broken. |
All Web Apis respect the accept-language Header. The given language Code ist used for strings which are returned |
I changed the system language to 'default_language' => 'de' . Then I created a new user namely deutschUser and added it to the admin group. When the deutschUser now logs in, the language in the web UI is Deutsch. But, when the deutschUser makes an API request to create an already existing user, the message is still "User already exists". |
@jasson99 try sending the See the link in comment #608 (comment) |
@DeepDiver1975 or anyone. Are |
no - plain english |
Hmmm - exceptions out of DAV do not seem to be translated, e.g. https://github.com/owncloud/core/blob/master/apps/dav/lib/Connector/Sabre/Directory.php#L262
I wonder how we find an example WebDAV call that will provide an "interesting" response that gets translated. |
It is highly possible that not all messages are translated 🤷♂️ Let me try to find a working example ... |
$ curl -H 'Accept-Language: de' -uadmin "http://localhost:8080/ocs/v2.php/apps/files_sharing/api/v1/shares/1"
Enter host password for user 'admin':
<?xml version="1.0"?>
<ocs>
<meta>
<status>failure</status>
<statuscode>404</statuscode>
<message>Fehlerhafte Freigabe-ID, Freigabe existiert nicht</message>
<totalitems></totalitems>
<itemsperpage></itemsperpage>
</meta>
<data/>
</ocs> |
Now we have some testing infrastructure for running test scenarios in different languages. The next question is "how widely do we test"?
If we want to know that every string that is required to be translated actually is translated, then there would be 1000 test cases. (that is, if we want some test to fail if any one of the Otherwise, what subset of test cases do we cover? |
I removed @Talank as assignee, marked as done in the current QA project, and put the issue back into the QA backlog. We need to discuss the comment #608 (comment) before doing more work. |
Currently, there are few places where we have tests for translations but the coverage is very low
What we can do more on this
|
It would be great to have acceptance tests for apps that show/display strings for translations.
Trying to catch when translations are not / no-longer working like in owncloud/files_antivirus#291
The text was updated successfully, but these errors were encountered: