rename strings
This commit is contained in:
parent
156dd7daa3
commit
e9027274a8
14 changed files with 51 additions and 51 deletions
|
@ -15,7 +15,7 @@ from .initialize import arcb30init
|
|||
from .song import get_song_info
|
||||
from .utils import get_userinfo
|
||||
|
||||
arc = module('arcaea', developers=['OasisAkari'], desc='{arcaea.desc}',
|
||||
arc = module('arcaea', developers=['OasisAkari'], desc='{arcaea.help}',
|
||||
alias={'b30': 'arcaea b30', 'a': 'arcaea', 'arc': 'arcaea'})
|
||||
webrender = Config('web_render')
|
||||
assets_path = os.path.abspath('./assets/arcaea')
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
"arcaea.message.unofficial.fetch.failed": "使用非官方API查询失败!",
|
||||
"arcaea.message.user.unbound": "未绑定用户,请使用~arcaea bind <friendcode>绑定一个用户。",
|
||||
"arcaea.message.no_webrender": "未配置webrender,无法使用此命令。",
|
||||
"arcaea.desc": "查询Arcaea相关内容。",
|
||||
"arcaea.help": "查询Arcaea相关内容。",
|
||||
"arcaea.b30.help": "查询一个Arcaea用户的b30列表(自动选择使用API)",
|
||||
"arcaea.b30.message.success": "获取结果\nB30: {b30} | R10: {r10}\nB30倒5列表:\n{last5list}",
|
||||
"arcaea.info.help": "查询一个Arcaea用户的最近游玩记录(自动选择使用API)",
|
||||
|
|
|
@ -23,8 +23,8 @@ css_names_to_hex = {**webcolors.CSS3_NAMES_TO_HEX, 'rebeccapurple': '#663399'}
|
|||
css_hex_to_names = {**webcolors.CSS3_HEX_TO_NAMES, '#663399': 'rebeccapurple'}
|
||||
|
||||
|
||||
@c.handle('<color> {{color.specify.help}}')
|
||||
@c.handle('{{color.random.help}}')
|
||||
@c.handle('<color> {{color.help.specify}}')
|
||||
@c.handle('{{color.help.random}}')
|
||||
async def _(msg: Bot.MessageSession):
|
||||
try:
|
||||
color = msg.parsed_msg.get('<color>')
|
||||
|
@ -58,7 +58,7 @@ async def _(msg: Bot.MessageSession):
|
|||
color = colorsys.hls_to_rgb(int(color[0].strip()[:-3]) / 360, int(color[2].strip()[:-1]) / 100, int(color[1].strip()[:-1]) / 100)
|
||||
color = webcolors.HTML5SimpleColor(*(int(x * 255) for x in color))
|
||||
else:
|
||||
await msg.finish(msg.locale.t('color.error'))
|
||||
await msg.finish(msg.locale.t('color.message.invalid'))
|
||||
|
||||
color_hex = '#%02x%02x%02x' % color
|
||||
color_rgb = 'rgb(%d, %d, %d)' % color
|
||||
|
@ -75,19 +75,19 @@ async def _(msg: Bot.MessageSession):
|
|||
css_color_name = ''
|
||||
css_color_name_short = ''
|
||||
if css_color_name_raw[1]:
|
||||
css_color_name = f'\n{msg.locale.t("color.css.name")}{css_color_name_raw[0]}'
|
||||
css_color_name = f'\n{msg.locale.t("color.message.css")}{css_color_name_raw[0]}'
|
||||
css_color_name_short = f'{css_color_name_raw[0]}\n'
|
||||
elif css_color_name_raw[0] is not None:
|
||||
css_color_name = f'\n{msg.locale.t("color.css.name.approximate")}{css_color_name_raw[0]}'
|
||||
css_color_name = f'\n{msg.locale.t("color.message.css.approximate")}{css_color_name_raw[0]}'
|
||||
|
||||
material_color_name_raw = get_color_name(color, material_colors_hex_to_names)
|
||||
material_color_name = ''
|
||||
material_color_name_short = ''
|
||||
if material_color_name_raw[1]:
|
||||
material_color_name = f'\n{msg.locale.t("color.md.name")}{material_color_name_raw[0]}'
|
||||
material_color_name = f'\n{msg.locale.t("color.message.md")}{material_color_name_raw[0]}'
|
||||
material_color_name_short = f'{material_color_name_raw[0]}\n'
|
||||
elif material_color_name_raw[0] is not None:
|
||||
material_color_name = f'\n{msg.locale.t("color.md.name.approximate")}{material_color_name_raw[0]}'
|
||||
material_color_name = f'\n{msg.locale.t("color.message.md.approximate")}{material_color_name_raw[0]}'
|
||||
|
||||
draw.multiline_text((250, 250), f'{css_color_name_short}{material_color_name_short}{color_hex}\n{color_rgb}\n{color_hsl}', font=font, fill=contrast, anchor='mm', align='center', spacing=20)
|
||||
await msg.finish([f'HEX:{color_hex}\nRGB:{color_rgb}\nHSL:{color_hsl}{css_color_name}{material_color_name}', BotImage(img)])
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"color.help": "Provide color information.",
|
||||
"color.random.help": "Random color.",
|
||||
"color.error": "An error occurred: Unrecognized color format.",
|
||||
"color.css.name": "CSS color name: ",
|
||||
"color.css.name.approximate": "Approximate CSS color name: ",
|
||||
"color.md.name": "Material Design color name: ",
|
||||
"color.md.name.approximate": "Approximate Material Design color name: ",
|
||||
"color.specify.help": "Provide color information. Support for Hex, RGB, HSL color code, or name in CSS and Material Design."
|
||||
"color.help.random": "Random color.",
|
||||
"color.message.invalid": "An error occurred: Unrecognized color format.",
|
||||
"color.message.css": "CSS color name: ",
|
||||
"color.message.css.approximate": "Approximate CSS color name: ",
|
||||
"color.message.md": "Material Design color name: ",
|
||||
"color.message.md.approximate": "Approximate Material Design color name: ",
|
||||
"color.help.specify": "Provide color information. Support for Hex, RGB, HSL color code, or name in CSS and Material Design."
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"color.help": "提供颜色信息。",
|
||||
"color.specify.help": "提供颜色信息。支持十六进制、RGB、HSL 颜色代码或 CSS 和 Material Design 中的颜色名称。",
|
||||
"color.random.help": "随机颜色。",
|
||||
"color.error": "发生错误:无法识别的颜色格式。",
|
||||
"color.css.name": "CSS 颜色名称:",
|
||||
"color.css.name.approximate": "最相似的 CSS 颜色名称:",
|
||||
"color.md.name": "Material Design 颜色名称:",
|
||||
"color.md.name.approximate": "最相似的 Material Design 颜色名称:"
|
||||
"color.help.specify": "提供颜色信息。支持十六进制、RGB、HSL 颜色代码或 CSS 和 Material Design 中的颜色名称。",
|
||||
"color.help.random": "随机颜色。",
|
||||
"color.message.invalid": "发生错误:无法识别的颜色格式。",
|
||||
"color.message.css": "CSS 颜色名称:",
|
||||
"color.message.css.approximate": "最相似的 CSS 颜色名称:",
|
||||
"color.message.md": "Material Design 颜色名称:",
|
||||
"color.message.md.approximate": "最相似的 Material Design 颜色名称:"
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"color.help": "提供色彩資訊。",
|
||||
"color.random.help": "隨機色彩。",
|
||||
"color.error": "發生錯誤:無法識別的色彩格式。",
|
||||
"color.css.name": "CSS 色彩名稱:",
|
||||
"color.css.name.approximate": "最相似的 CSS 色彩名稱:",
|
||||
"color.md.name": "Material Design 色彩名稱:",
|
||||
"color.md.name.approximate": "最相似的 Material Design 色彩名稱:",
|
||||
"color.specify.help": "提供色彩資訊。支援十六進位、RGB、HSL 顏色代碼或 CSS 和 Material Design 中的顏色名稱。"
|
||||
"color.help.random": "隨機色彩。",
|
||||
"color.message.invalid": "發生錯誤:無法識別的色彩格式。",
|
||||
"color.message.css": "CSS 色彩名稱:",
|
||||
"color.message.css.approximate": "最相似的 CSS 色彩名稱:",
|
||||
"color.message.md": "Material Design 色彩名稱:",
|
||||
"color.message.md.approximate": "最相似的 Material Design 色彩名稱:",
|
||||
"color.help.specify": "提供色彩資訊。支援十六進位、RGB、HSL 顏色代碼或 CSS 和 Material Design 中的顏色名稱。"
|
||||
}
|
|
@ -13,7 +13,7 @@ p = module('ptt',
|
|||
developers=['OasisAkari'])
|
||||
|
||||
|
||||
@p.handle('<potential> {{ptt.desc}}')
|
||||
@p.handle('<potential> {{ptt.help}}')
|
||||
async def pttimg(msg: Bot.MessageSession):
|
||||
ptt = msg.parsed_msg['<potential>']
|
||||
# ptt
|
||||
|
@ -23,7 +23,7 @@ async def pttimg(msg: Bot.MessageSession):
|
|||
try:
|
||||
ptt = float(ptt)
|
||||
except ValueError:
|
||||
await msg.finish(msg.locale.t('ptt.invalid'))
|
||||
await msg.finish(msg.locale.t('ptt.message.invalid'))
|
||||
if ptt >= 13.00:
|
||||
pttimg = 7
|
||||
elif ptt >= 12.50:
|
||||
|
@ -76,7 +76,7 @@ async def pttimg(msg: Bot.MessageSession):
|
|||
drawptt = ImageDraw.Draw(pttimg)
|
||||
drawptt.text((0, 0), ptt, 'white', font=font1, stroke_width=3, stroke_fill='#52495d')
|
||||
else:
|
||||
return await msg.finish('发生错误:potential 必须为 ≥0.00 且 ≤99.99 的数字。')
|
||||
return await msg.finish(msg.locale.t('ptt.message.invalid'))
|
||||
pttimg_width, pttimg_height = pttimg.size
|
||||
ptttext.alpha_composite(pttimg,
|
||||
(int((ptttext_width - pttimg_width) / 2), int((ptttext_height - pttimg_height) / 2) - 11))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"ptt.desc": "Generate a Potential image of Arcaea.",
|
||||
"ptt.invalid": "An error occurred: Potential must be a number greater than 0.00 and less than 99.99."
|
||||
"ptt.help": "Generate a Potential image of Arcaea.",
|
||||
"ptt.message.invalid": "An error occurred: Potential must be a number greater than 0.00 and less than 99.99."
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"ptt.desc": "生成一张 Arcaea Potential 图片。",
|
||||
"ptt.invalid": "发生错误:Potential 必须为 ≥0.00 且 ≤99.99 的数字。"
|
||||
"ptt.help": "生成一张 Arcaea Potential 图片。",
|
||||
"ptt.message.invalid": "发生错误:Potential 必须为 ≥0.00 且 ≤99.99 的数字。"
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"ptt.desc": "生成一張 Arcaea Potential 圖片。",
|
||||
"ptt.invalid": "發生錯誤:Potential 必須為 ≥0.00 且 ≤99.99 的數字。"
|
||||
"ptt.help": "生成一張 Arcaea Potential 圖片。",
|
||||
"ptt.message.invalid": "發生錯誤:Potential 必須為 ≥0.00 且 ≤99.99 的數字。"
|
||||
}
|
|
@ -8,7 +8,7 @@ from core.component import module
|
|||
r = module('random', alias={'rand': 'random', 'rng': 'random'}, developers=['Dianliang233'], desc='{random.help}', )
|
||||
|
||||
|
||||
@r.handle('number <min> <max> {{random.number.help}}', )
|
||||
@r.handle('number <min> <max> {{random.help.number}}', )
|
||||
async def _(msg: Bot.MessageSession):
|
||||
_min = msg.parsed_msg['<min>']
|
||||
_max = msg.parsed_msg['<max>']
|
||||
|
@ -16,12 +16,12 @@ async def _(msg: Bot.MessageSession):
|
|||
await msg.finish('' + str(random))
|
||||
|
||||
|
||||
@r.handle('choice ... {{random.choice.help}}', )
|
||||
@r.handle('choice ... {{random.help.choice}}', )
|
||||
async def _(msg: Bot.MessageSession):
|
||||
choices = msg.parsed_msg['...']
|
||||
await msg.finish(secrets.choice(choices))
|
||||
|
||||
|
||||
@r.handle('uuid {{random.uuid.help}}', )
|
||||
@r.handle('uuid {{random.help.uuid}}', )
|
||||
async def _(msg: Bot.MessageSession):
|
||||
await msg.finish(str(uuid.uuid4()))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"random.help": "Random number generator (cryptographically secure)",
|
||||
"random.number.help": "Generate a random integer within a given range.",
|
||||
"random.choice.help": "Select an element from a given set.",
|
||||
"random.uuid.help": "Generate random UUID (v4)."
|
||||
"random.help.number": "Generate a random integer within a given range.",
|
||||
"random.help.choice": "Select an element from a given set.",
|
||||
"random.help.uuid": "Generate random UUID (v4)."
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"random.help": "随机数生成器(密码学安全)",
|
||||
"random.number.help": "生成区间内的随机整数。",
|
||||
"random.choice.help": "从集合中选择元素。",
|
||||
"random.uuid.help": "生成随机 UUID(v4)。"
|
||||
"random.help.number": "生成区间内的随机整数。",
|
||||
"random.help.choice": "从集合中选择元素。",
|
||||
"random.help.uuid": "生成随机 UUID(v4)。"
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"random.help": "隨機數生成器(密碼學安全)",
|
||||
"random.number.help": "產生區間內的隨機整數。",
|
||||
"random.choice.help": "從集合中選擇元素。",
|
||||
"random.uuid.help": "產生隨機 UUID(v4)。"
|
||||
"random.help.number": "產生區間內的隨機整數。",
|
||||
"random.help.choice": "從集合中選擇元素。",
|
||||
"random.help.uuid": "產生隨機 UUID(v4)。"
|
||||
}
|
||||
|
|
Reference in a new issue