langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
47.11k stars 6.69k forks source link

Issue with the "Link Expiration Page" Displaying in Chinese Instead of Japanese #4712

Closed t-daisuke closed 2 months ago

t-daisuke commented 4 months ago

Self Checks

Dify version

0.6.9

Utility with translation issue

Japan

🌐 Language affected

Japanese

❌ Actual phrase(s)

スクリーンショット 2024-05-28 15 26 07

I selected Japanese from the language options in the top-right corner. However, the text remained in Chinese and did not change.Resolving this issue would make it easier for Japanese users to understand and use the system.

✔️ Expected phrase(s)

リンクの有効期限が切れています

ℹ Why is the current translation wrong

This is because the words are in Chinese, which Japanese people cannot read. They cannot understand the meaning or the pronunciation.

dosubot[bot] commented 4 months ago

Hello, @t-daisuke! I'm here to help you with any bugs, questions, or contributions you have for our repository. Let me know how I can assist you!

The issue you're experiencing with the "Link Expiration Page" displaying in Chinese instead of Japanese could be due to several factors, including caching mechanisms or incorrect language settings. Here are some steps to troubleshoot and resolve the issue:

  1. Check Language Support: Ensure that Japanese (ja-JP) is listed as a supported language in the languages.json file and that the supported field is set to true.

    {
      "value": "ja-JP",
      "name": "日本語",
      "prompt_name": "Japanese",
      "example": "こんにちは、Dify!",
      "supported": true
    }
  2. Clear Browser Cache: Sometimes, cached data can cause the wrong language to be displayed. Clear your browser cache and cookies to ensure that the latest settings are applied.

  3. Check Language Cookie: Verify that the language preference is correctly stored in the LOCALE_COOKIE_NAME cookie. You can do this by inspecting the cookies in your browser's developer tools.

  4. Verify Translation Files: Ensure that the translation files for Japanese are correctly placed and contain the appropriate translations. The translation files should be located in the web/i18n/ja-JP directory.

  5. Fallback Language: Ensure that the fallback language mechanism is correctly implemented. The getLanguage function should return the correct language code if the selected language is not available.

    export const getLanguage = (locale: string) => {
      if (locale === 'ja-JP')
        return locale.replace('-', '_')
    
      return LanguagesSupported[0].replace('-', '_')
    }
  6. Debugging Tools: Use the application logs or debugging tools to trace language selection events and errors. This can help identify why the language might not be switching correctly.

By following these steps, you should be able to resolve the issue and ensure that the "Link Expiration Page" displays the correct Japanese text. If the problem persists, further investigation into the application logs and debugging tools may be necessary.

#### 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.

crazywoola commented 4 months ago
image image

I am trying to fix this problem you mentioned. But it seems I can not reproduce the problem.