-
Notifications
You must be signed in to change notification settings - Fork 119
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
Add support for multiple languages #510
Conversation
translate title and abstract for processes, inputs and outputs
Codacy complains about mutable default arguments (not in this PR) and TravisCI fails because http://test.opendap.org/opendap is down right now... |
Here is an example of how we would add translations for a process and its inputs: from pywps import Process, LiteralInput, LiteralOutput
class SayHello(Process):
def __init__(self):
inputs = [
LiteralInput(
'name',
title='Input name',
abstract='The name to say hello to.',
translations={"fr-CA": {"abstract": "Le nom à saluer."}}
)
],
outputs=[
LiteralOutput(
'response',
title='Output response',
abstract='The complete output message.',
translations={"fr-CA": {
"title": "La réponse",
"abstract": "Le message complet."
}}
)
],
super().__init__(
self._handler,
identifier='say_hello',
title='Process Say Hello',
abstract='Returns a literal string output with Hello plus the inputed name',
version='1.0',
inputs=inputs,
outputs=outputs,
store_supported=True,
status_supported=True,
translations={"fr-CA": {
"title": "Processus Dire Bonjour",
"abstract": "Retourne une chaine de caractères qui dit bonjour au nom fournit en entrée."
}},
) @huard, do you think there could be a more intuitive way to specify the translations? |
@davidcaron I like the interface. It's close to the code, it obvious what to do. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
tests are working now. I have checked for merge conflicts with PR #505 and there are none. Safe to merge. |
@davidcaron merged. Thanks for adding this :) |
Overview
The 3 requests types are translated (GetCapabilities, DescribeProcess, Execute).
I translated only the title and abstract attributes for processes, inputs and outputs. Should something else be translated?
See the changes to
docs/process.rst
for an example of the interface.Contribution Agreement