Skip to content
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

Use error message const to avoid replication. #2502

Closed
wants to merge 1 commit into from

Conversation

lzbj
Copy link
Contributor

@lzbj lzbj commented Jul 18, 2017

As we discussed before.. If we agree this is correct, I'll continue the remain ones.

Copy link
Member

@rabbah rabbah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the change has to reach the error messages file.

@mrutkows
Copy link
Contributor

mrutkows commented Jul 18, 2017

As @rabbah (I believe) is indicating...
https://github.com/apache/incubator-openwhisk/tree/master/tools/cli/go-whisk-cli/wski18n/resources

and specifically the translated map:

{
    "id": "Unable to create action '{{.name}}': {{.err}}",
    "translation": "Unable to create action '{{.name}}': {{.err}}"
},

@markusthoemmes
Copy link
Contributor

Specifically the id in the translation file should be a well known constant, like

{
    "id": "ACTION_CREATE_UNABLE",
    "translation": "Unable to create action '{{.name}}': {{.err}}"
},

@lzbj
Copy link
Contributor Author

lzbj commented Jul 20, 2017

Seems doesn't work like that, @mdeuser , could you please help take a review?

@@ -34,6 +34,7 @@ const NO_DISPLAY_PREFIX bool = false
const APPLICATION_ERR bool = true
const NO_APPLICATION_ERR bool = false
const TIMED_OUT bool = true
const UNABLE_CREATE_ACTION_ERR string = "Unable to create action '{{.name}}': {{.err}}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be

const UNABLE_CREATE_ACTION_ERR  string = "UNABLE_CREATE_ACTION_ERR"

to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thank you for your help @markusthoemmes , seems I don't t get the real spirit of of the issue yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants