-
Notifications
You must be signed in to change notification settings - Fork 40
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
API: String entries are not localized #406
Comments
They are translated with the language the user selected in the web UI, should be sufficient? |
No, I do not think so. Client- and server language settings have nothing to do with each other. |
I guess the number of people that have client and server set to different languages is pretty low, but I can try to read the language from the accept-language header, if you think it is really necessary. |
Yes, I think that. There seems to be a considerable number of people who never open the web interface but only sync in large organizations. An example might be an US company with a branch in china, they will have an english server by default, but the desktops of the people will be in their locale. I don't think we want to force them to go to their personal settings on a for them unknown website first (in a language they do not understand) to switch. It's the small things that make a good software perfect ;-) |
The language is already taken from the Accept-Language header in core - see https://github.com/owncloud/core/blob/master/ocs/v1.php#L49 |
yeah just found that as well and it works for me using curl, when I hardcode the value in https://github.com/owncloud/core/blob/master/lib/private/l10n.php#L107 and https://github.com/owncloud/core/blob/master/lib/private/l10n.php#L113 |
$ curl -H "Accept-Language:de;q=0.8" http://admin:admin@localhost:8080/ocs/v1.php/cloud/activity
<?xml version="1.0"?>
<ocs>
<meta>
<status>ok</status>
<statuscode>100</statuscode>
<message/>
</meta>
<data>
<element>
<id>10</id>
<subject>Du hast IMG_2003.JPG, IMG_2004.JPG, IMG_2020.JPG und 3 weitere erstellt</subject>
<message></message>
<file>/IMG_2003.JPG</file>
<link>http://localhost:8080/index.php/apps/files?dir=%2F</link>
<date>2015-10-08T10:38:46+00:00</date>
</element>
<element>
<id>4</id>
<subject>Du hast IMG_2035.JPG, IMG_2110.JPG, IMG_2148.JPG und IMG_2165.JPG erstellt</subject>
<message></message>
<file>/IMG_2035.JPG</file>
<link>http://localhost:8080/index.php/apps/files?dir=%2F</link>
<date>2015-10-08T10:38:19+00:00</date>
</element>
</data>
</ocs> $ curl -H "Accept-Language:es;q=0.8" http://admin:admin@localhost:8080/ocs/v1.php/cloud/activity
<?xml version="1.0"?>
<ocs>
<meta>
<status>ok</status>
<statuscode>100</statuscode>
<message/>
</meta>
<data>
<element>
<id>10</id>
<subject>Ha creado IMG_2003.JPG, IMG_2004.JPG, IMG_2020.JPG y 3 más</subject>
<message></message>
<file>/IMG_2003.JPG</file>
<link>http://localhost:8080/index.php/apps/files?dir=%2F</link>
<date>2015-10-08T10:38:46+00:00</date>
</element>
<element>
<id>4</id>
<subject>Ha creado IMG_2035.JPG, IMG_2110.JPG, IMG_2148.JPG y IMG_2165.JPG</subject>
<message></message>
<file>/IMG_2035.JPG</file>
<link>http://localhost:8080/index.php/apps/files?dir=%2F</link>
<date>2015-10-08T10:38:19+00:00</date>
</element>
</data>
</ocs> |
from my pov this can be closed since it's working |
Yes, thanks & my apologies. I tested with 8.0.x where it's not yet working... |
The API returns strings in the
subject
and themessage
tag at least. These are in an english locale, not translated.If I read the code correctly, there is no way for the client to specify the language the server should return. That could either be done with an additional parameter, or, via the
Accept-Language
header as described here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.htmlThis blocks owncloud/client#3732
The text was updated successfully, but these errors were encountered: