如何添加最简单的第二种语言

问题描述

我在js上有一些命令,例如!help,但我也想用土耳其语来做,例如!yardım

现在我所有的资料来源都是英文。但我找不到一种方法来简单地添加第二种语言。

这是我的代码

commands.js

const price = (sender) => {
    games.getPrice((error,random,unique) => {
        if(error) {
            if(typeof error != 'string') {
                console.error(error);
                return steam.message(sender,"/pre An error occurred,please try again later.");
            }

            return steam.message(sender,error);
        }

        let Price = "/pre Currently,prices are: "  + EOL ;
    
        if(unique.length > 0)
            Price +=  EOL + "Unique games  " + EOL;
            Price += unique;
        if(random.length > 0)
            Price +=  EOL +  "Random games" + EOL ; 
            Price += random ;
        
        steam.message(sender,Price);
    });
}


const commands = {
price: {
    description: 'displays my prices.',admin: false,exec: price
}
}

该项目是一个蒸汽机器人。我希望用户使用!eng或!tr命令选择一种语言。最困难的方法是对数据库进行操作,但是我不想不必要地使服务器疲劳,并且数据库是一种困难的方法

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)