apache / incubator-hugegraph-toolchain

HugeGraph toolchain - include a series useful graph modules
https://hugegraph.apache.org/
Apache License 2.0
88 stars 92 forks source link

[Question] Hubble web page Chinese display messy code #608

Closed xyk98 closed 1 month ago

xyk98 commented 4 months ago

Problem Type (问题类型)

dashboard render (前端渲染问题)

Before submit

Environment (环境信息)

Your Question (问题描述)

After deploying hugegraph and hugegraph-hubble via docker, create the Chinese attribute "姓名" on the hubble web page, and display the attribute name as "???". Hubble web page:

11FD42E5-EB79-4a2e-AB3C-4B8DB8AE1CD3

Docker:

F02D5D43-3CA7-416d-87F1-350FEB1AC565

docker-compose.yml: version: '3' services: hugegraph-server: image: hugegraph/hugegraph:1.2.0 container_name: hugegraph restart: always ports:

Vertex/Edge example (问题点 / 边数据举例)

No response

Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

No response

dosubot[bot] commented 4 months ago

Hey @xyk98! 👋 I'm here to help you with bug fixes, answer questions, and guide you on becoming a contributor. Let's squash those bugs together!

To resolve the issue of Chinese characters displaying as "???" on the Hubble web page after deploying HugeGraph and HugeGraph-Hubble via Docker, you need to ensure that the encoding settings are correctly configured to UTF-8.

Here is how you can modify the Docker setup to ensure UTF-8 encoding:

  1. Modify the Dockerfile to include the necessary environment variables for UTF-8 encoding.
FROM hugegraph/hubble

# Set environment variables for UTF-8 encoding
ENV LANG C.UTF-8
ENV LANGUAGE C.UTF-8
ENV LC_ALL C.UTF-8

# Other Dockerfile instructions
  1. Update the docker-compose.yml file to ensure the environment variables are set correctly.
version: '3'
services:
  server:
    image: hugegraph/hugegraph
    container_name: server
    ports:
      - 8080:8080

  hubble:
    image: hugegraph/hubble
    container_name: hubble
    ports:
      - 8088:8088
    environment:
      - LANG=C.UTF-8
      - LANGUAGE=C.UTF-8
      - LC_ALL=C.UTF-8

Additionally, ensure that the messages_zh_CN.properties file is correctly configured and included in your deployment. This file contains the necessary Chinese translations for various messages and should be located in the hugegraph-hubble/hubble-be/src/main/resources/i18n/ directory [1][2].

By setting these environment variables and ensuring the correct properties file is included, you ensure that the Docker containers use UTF-8 encoding and the application can properly display Chinese characters, resolving the issue of Chinese characters displaying as "???".

#### Details **About Dosu** This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

github-actions[bot] commented 3 months ago

Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label

github-actions[bot] commented 3 months ago

Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label

imbajin commented 3 months ago

@xyk98 any update after @dosu 's suggestion? (Or close it if fixed)

dosubot[bot] commented 3 months ago

To resolve the issue of Chinese characters displaying as "???" on the Hubble web page after deploying HugeGraph and HugeGraph-Hubble via Docker, you need to ensure that the encoding settings are correctly configured to UTF-8.

Here is how you can modify the Docker setup to ensure UTF-8 encoding:

  1. Modify the Dockerfile to include the necessary environment variables for UTF-8 encoding.
FROM hugegraph/hubble

# Set environment variables for UTF-8 encoding
ENV LANG C.UTF-8
ENV LANGUAGE C.UTF-8
ENV LC_ALL C.UTF-8

# Other Dockerfile instructions
  1. Update the docker-compose.yml file to ensure the environment variables are set correctly.
version: '3'
services:
  hugegraph-server:
    image: hugegraph/hugegraph:1.2.0
    container_name: hugegraph
    restart: always
    ports:
      - 18080:8080

  hugegraph-hubble:
    image: hugegraph/hubble:1.2.0
    container_name: hugegraph-hubble
    restart: always
    ports:
      - 18088:8088
    environment:
      - LANG=C.UTF-8
      - LANGUAGE=C.UTF-8
      - LC_ALL=C.UTF-8

Additionally, ensure that the messages_zh_CN.properties file is correctly configured and included in your deployment. This file contains the necessary Chinese translations for various messages and should be located in the hugegraph-hubble/hubble-be/src/main/resources/i18n/ directory .

By setting these environment variables and ensuring the correct properties file is included, you ensure that the Docker containers use UTF-8 encoding and the application can properly display Chinese characters, resolving the issue of Chinese characters displaying as "???".

Let us know if this resolves your issue or if you need further assistance!

To continue talking to Dosu, mention @dosu.

github-actions[bot] commented 2 months ago

Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label