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

Changing language doesn't work. #917

Open
odhinn84 opened this issue Mar 12, 2023 · 4 comments
Open

Changing language doesn't work. #917

odhinn84 opened this issue Mar 12, 2023 · 4 comments

Comments

@odhinn84
Copy link

  1. Use an old laptop as an online judge (OJ) server.
  2. Install Ubuntu 22.04 operating system.
  3. Clone the HUST Online Judge (HUSTOJ) via Git.
  4. Install the version of HUSTOJ that is compatible with Ubuntu 22.04.
  5. Edit the "db_info.inc.php" file to change the "OJ_LANG" variable to "ko" to set the language to Korean.
  6. Check that the language has been changed by opening the HUSTOJ website on the server computer using the Google Chrome browser.
  7. Configure the port forwarding and ufw settings to allow external connections to the OJ server.
  8. Try to connect to the OJ server from an external network.
  9. Successfully connect to the OJ server from an external network, but the language setting has not changed.

Localhost still outputs normally in the converted language.

I would be grateful if you could tell me how to do it.

I am new to programming, so I would appreciate a bit more detailed explanation. Thank you very much for providing good service.

@zhblue
Copy link
Owner

zhblue commented Mar 13, 2023

check out the routings in init.php
cookies and browser annoucement can override the default settings

@syudal
Copy link

syudal commented Aug 29, 2023

Hi, I'm Korean, and I don't know any Chinese.

I think the problem is caused by the different content of HTTP_ACCEPT_LANGUAGE in Edge and Chrome.

In my case, on the same operating system, Edge returns ko,en;q=0.9,en-US;q=0.8.
Chrome returns en-US,en;q=0.9,en-US;q=0.8,en;q=0.7,zh-CN;q=0.6,zh;q=0.5.

Therefore, you need to modify lines 11 through 13 of include\init.php.

Hope this helps.

syudal added a commit to syudal/hustoj that referenced this issue Sep 27, 2023
HTTP_ACCEPT_LANGUAGE Multi-language support
zhblue#917
@syudal syudal mentioned this issue Sep 27, 2023
@zhblue
Copy link
Owner

zhblue commented Sep 27, 2023

greate work! thank you!

@syudal
Copy link

syudal commented Sep 27, 2023

No problem, I'm glad it was helpful.

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

No branches or pull requests

3 participants