Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

i18n in Firewall edit error #2079

Closed
mysterynet opened this issue Oct 30, 2021 · 6 comments
Closed

i18n in Firewall edit error #2079

mysterynet opened this issue Oct 30, 2021 · 6 comments
Assignees
Milestone

Comments

@mysterynet
Copy link

Operating System (OS/VERSION):

Centos 7

VestaCP Version:

1.0.0(x86_64)

Related Issues/Forum Threads:

When use language cn(chinese) and other not en(english), the firewall edit page will make error request like this:

======post request======
------WebKitFormBoundary
Content-Disposition: form-data; name="ok"
add
------WebKitFormBoundary
Content-Disposition: form-data; name="token"
===hidden===
------WebKitFormBoundary
Content-Disposition: form-data; name="v_action"
阻止
------WebKitFormBoundary
Content-Disposition: form-data; name="v_protocol"
TCP
------WebKitFormBoundary
Content-Disposition: form-data; name="v_port"
11
------WebKitFormBoundary
Content-Disposition: form-data; name="v_ip"
0.0.0.0/0
------WebKitFormBoundary
Content-Disposition: form-data; name="v_comment"
------WebKitFormBoundary--
======end======
In v_action section the 阻止 is DROP,this problem also broken in jp(and other).
jp:拒否
ar:حذف
.....

I think maybe the value in the request need to change to 'DROP' Not the word in user's language

@mysterynet
Copy link
Author

the api response this:
{"ok_msg":null,"error_msg":"Error: invalid action format :: \u963b\u6b62"}

@jaapmarcus
Copy link
Contributor

v_action should not be translated..

@anton-reutov
Copy link
Collaborator

anton-reutov commented Oct 30, 2021

I can't reproduce this. Can you send some screenshots, or video?
Or steps how to reproduce this

@jaapmarcus
Copy link
Contributor

Use a non alphanumeric language like Chinese ...

@mysterynet
Copy link
Author

I can't reproduce this. Can you send some screenshots, or video? Or steps how to reproduce this

ok, plz wait

@mysterynet
Copy link
Author

mysterynet commented Oct 31, 2021

In file src/react/src/components/Firewall/Add/AddFirewall.jsx
==line:23
const [state, setState] = useState({
loading: false,
actions: [
i18n['DROP'], <-here translate the action to user'language
i18n['ACCEPT'] <-here translate the action to user'language
],
protocols: [
i18n['TCP'],
i18n['UDP'],
i18n['ICMP']
],
okMessage: '',
errorMessage: ''
});

==line:96
<SelectInput
options={state.actions} <- here just use the translated action
name="v_action"
id="action"
title={i18n['Action']} />

Maybe here need to change something?

Follow is the step to reproduce

  1. change vestacp to non English(here I will use cn,jp to show)
    1
    2

  2. select the firewall here
    3

  3. add a firewall record(edit is also fine)
    4

  4. choose the action like "放行" mean "accept" and add other information
    5

5.click button add(or edit)
6
will see this report, it mean this is a invalid action about "放行"(the '放行' is translate in chinese not english "ACCEPT")
This will also reproduce in ja.
9

The option value is translate to user's language at this
image

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

No branches or pull requests

4 participants