mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-13 22:35:54 +08:00
chore: Enable Japanese descriptions for Tools (#8646)
This commit is contained in:
parent
cae73b9a32
commit
03fdf5e7f8
@ -10,6 +10,7 @@ class I18nObject(BaseModel):
|
|||||||
|
|
||||||
zh_Hans: Optional[str] = None
|
zh_Hans: Optional[str] = None
|
||||||
pt_BR: Optional[str] = None
|
pt_BR: Optional[str] = None
|
||||||
|
ja_JP: Optional[str] = None
|
||||||
en_US: str
|
en_US: str
|
||||||
|
|
||||||
def __init__(self, **data):
|
def __init__(self, **data):
|
||||||
@ -18,6 +19,8 @@ class I18nObject(BaseModel):
|
|||||||
self.zh_Hans = self.en_US
|
self.zh_Hans = self.en_US
|
||||||
if not self.pt_BR:
|
if not self.pt_BR:
|
||||||
self.pt_BR = self.en_US
|
self.pt_BR = self.en_US
|
||||||
|
if not self.ja_JP:
|
||||||
|
self.ja_JP = self.en_US
|
||||||
|
|
||||||
def to_dict(self) -> dict:
|
def to_dict(self) -> dict:
|
||||||
return {"zh_Hans": self.zh_Hans, "en_US": self.en_US, "pt_BR": self.pt_BR}
|
return {"zh_Hans": self.zh_Hans, "en_US": self.en_US, "pt_BR": self.pt_BR, "ja_JP": self.ja_JP}
|
||||||
|
@ -4,9 +4,11 @@ identity:
|
|||||||
label:
|
label:
|
||||||
en_US: ArXiv
|
en_US: ArXiv
|
||||||
zh_Hans: ArXiv
|
zh_Hans: ArXiv
|
||||||
|
ja_JP: ArXiv
|
||||||
description:
|
description:
|
||||||
en_US: Access to a vast repository of scientific papers and articles in various fields of research.
|
en_US: Access to a vast repository of scientific papers and articles in various fields of research.
|
||||||
zh_Hans: 访问各个研究领域大量科学论文和文章的存储库。
|
zh_Hans: 访问各个研究领域大量科学论文和文章的存储库。
|
||||||
|
ja_JP: 多様な研究分野の科学論文や記事の膨大なリポジトリへのアクセス。
|
||||||
icon: icon.svg
|
icon: icon.svg
|
||||||
tags:
|
tags:
|
||||||
- search
|
- search
|
||||||
|
@ -4,10 +4,12 @@ identity:
|
|||||||
label:
|
label:
|
||||||
en_US: Arxiv Search
|
en_US: Arxiv Search
|
||||||
zh_Hans: Arxiv 搜索
|
zh_Hans: Arxiv 搜索
|
||||||
|
ja_JP: Arxiv 検索
|
||||||
description:
|
description:
|
||||||
human:
|
human:
|
||||||
en_US: A tool for searching scientific papers and articles from the Arxiv repository. Input can be an Arxiv ID or an author's name.
|
en_US: A tool for searching scientific papers and articles from the Arxiv repository. Input can be an Arxiv ID or an author's name.
|
||||||
zh_Hans: 一个用于从Arxiv存储库搜索科学论文和文章的工具。 输入可以是Arxiv ID或作者姓名。
|
zh_Hans: 一个用于从Arxiv存储库搜索科学论文和文章的工具。 输入可以是Arxiv ID或作者姓名。
|
||||||
|
ja_JP: Arxivリポジトリから科学論文や記事を検索するためのツールです。入力はArxiv IDまたは著者名にすることができます。
|
||||||
llm: A tool for searching scientific papers and articles from the Arxiv repository. Input can be an Arxiv ID or an author's name.
|
llm: A tool for searching scientific papers and articles from the Arxiv repository. Input can be an Arxiv ID or an author's name.
|
||||||
parameters:
|
parameters:
|
||||||
- name: query
|
- name: query
|
||||||
@ -16,8 +18,10 @@ parameters:
|
|||||||
label:
|
label:
|
||||||
en_US: Query string
|
en_US: Query string
|
||||||
zh_Hans: 查询字符串
|
zh_Hans: 查询字符串
|
||||||
|
ja_JP: クエリ文字列
|
||||||
human_description:
|
human_description:
|
||||||
en_US: The Arxiv ID or author's name used for searching.
|
en_US: The Arxiv ID or author's name used for searching.
|
||||||
zh_Hans: 用于搜索的Arxiv ID或作者姓名。
|
zh_Hans: 用于搜索的Arxiv ID或作者姓名。
|
||||||
|
ja_JP: 検索に使用されるArxiv IDまたは著者名。
|
||||||
llm_description: The Arxiv ID or author's name used for searching.
|
llm_description: The Arxiv ID or author's name used for searching.
|
||||||
form: llm
|
form: llm
|
||||||
|
@ -74,12 +74,14 @@ class ToolTransformService:
|
|||||||
en_US=provider_controller.identity.description.en_US,
|
en_US=provider_controller.identity.description.en_US,
|
||||||
zh_Hans=provider_controller.identity.description.zh_Hans,
|
zh_Hans=provider_controller.identity.description.zh_Hans,
|
||||||
pt_BR=provider_controller.identity.description.pt_BR,
|
pt_BR=provider_controller.identity.description.pt_BR,
|
||||||
|
ja_JP=provider_controller.identity.description.ja_JP,
|
||||||
),
|
),
|
||||||
icon=provider_controller.identity.icon,
|
icon=provider_controller.identity.icon,
|
||||||
label=I18nObject(
|
label=I18nObject(
|
||||||
en_US=provider_controller.identity.label.en_US,
|
en_US=provider_controller.identity.label.en_US,
|
||||||
zh_Hans=provider_controller.identity.label.zh_Hans,
|
zh_Hans=provider_controller.identity.label.zh_Hans,
|
||||||
pt_BR=provider_controller.identity.label.pt_BR,
|
pt_BR=provider_controller.identity.label.pt_BR,
|
||||||
|
ja_JP=provider_controller.identity.label.ja_JP,
|
||||||
),
|
),
|
||||||
type=ToolProviderType.BUILT_IN,
|
type=ToolProviderType.BUILT_IN,
|
||||||
masked_credentials={},
|
masked_credentials={},
|
||||||
|
@ -31,10 +31,8 @@ export const languages = data.languages
|
|||||||
export const LanguagesSupported = languages.filter(item => item.supported).map(item => item.value)
|
export const LanguagesSupported = languages.filter(item => item.supported).map(item => item.value)
|
||||||
|
|
||||||
export const getLanguage = (locale: string) => {
|
export const getLanguage = (locale: string) => {
|
||||||
if (locale === 'zh-Hans')
|
const supportedLocale = LanguagesSupported.find(lang => lang.startsWith(locale.split('-')[0]))
|
||||||
return locale.replace('-', '_')
|
return (supportedLocale || LanguagesSupported[0]).replace('-', '_')
|
||||||
|
|
||||||
return LanguagesSupported[0].replace('-', '_')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NOTICE_I18N = {
|
export const NOTICE_I18N = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user