本篇文章给大家谈谈如何更改moment.js的语言?,以及moment-with-locales.js的知识点,同时本文还将给你拓展AfterEffect切换中英文教程AE软件如何更改语言?、andr
本篇文章给大家谈谈如何更改 moment.js 的语言?,以及moment-with-locales.js的知识点,同时本文还将给你拓展After Effect 切换中英文教程 AE 软件如何更改语言?、android – 如何通过单击更改整个应用程序的语言?、android-如何更改整个应用程序语言?、android-如何更改日历视图的语言?等相关知识,希望对各位有所帮助,不要忘了收藏本站喔。
本文目录一览:- 如何更改 moment.js 的语言?(moment-with-locales.js)
- After Effect 切换中英文教程 AE 软件如何更改语言?
- android – 如何通过单击更改整个应用程序的语言?
- android-如何更改整个应用程序语言?
- android-如何更改日历视图的语言?
如何更改 moment.js 的语言?(moment-with-locales.js)
我正在尝试更改由 moment.js 设置的日期的语言。默认的是英语,但我想设置德语。这些是我尝试过的:
var now = moment().format("LLL").lang("de");
它是给予NaN
。
var now = moment("de").format("LLL");
这甚至没有反应。
var now = moment().format("LLL", "de");
没有变化:这仍然会产生英语结果。
这怎么可能?
答案1
小编典典您需要 moment.lang ( WARNING :lang()
自 moment 以来已弃用2.8.0
,请locale()
改用):
moment.lang("de").format(''LLL'');
http://momentjs.com/docs/#/i18n/
从 v2.8.1 开始,moment.locale(''de'')
设置本地化,但不返回moment
. 一些例子:
var march = moment(''2017-03'')console.log(march.format(''MMMM'')) // ''March''moment.locale(''de'') // returns the new locale, in this case ''de''console.log(march.format(''MMMM'')) // ''March'' still, since the instance was before the locale was setvar deMarch = moment(''2017-03'')console.log(deMarch.format(''MMMM'')) // ''M盲rz''// You can, however, change just the locale of a specific momentmarch.locale(''es'')console.log(march.format(''MMMM'')) // ''Marzo''
总之,调用locale
全局moment
设置所有未来moment
实例的语言环境,但不返回moment
.
调用locale
一个实例,为该实例设置它并返回该实例。
此外,正如 Shiv 在评论中所说,请确保您使用“moment-with-
locales.min.js”而不是“moment.min.js”,否则它将无法正常工作。
After Effect 切换中英文教程 AE 软件如何更改语言?

After Effect 安装之后想要切换语言怎么办?这里为大家带来 After Effect 切换中英文教程,帮助大家解决系统语言不通导致 ae 模板表达式错误。新版本已经不能通过首选项更改语言设置了,要从 application.xml 文件进行修改,请大家阅读以下内容。
Mac 版 ae application.xml 文件所在的路径位置为:/Library/Application Support/Adobe/After Effects/22.0/AMT,这里的 22.0 代表 ae 版本为 2022,After Effects 2023 版本为 23.0,After Effects 2024 版本为 24.0
先将这个 application.xml 文件复制到桌面一份,右键选择文本编辑工具打开,修改 languages 值,command+F 搜索 “Language”
然后把 en_US(或者 en_GB)修改为 zh_CN,则会把软件界面从英文改为中文,反之则中文改为英文。
修改后保存文件,再覆盖回原来的位置。重启 ae 即可发现软件界面的中英文字切换成功了。
After Effect 2024 最新中文版 for Mac 下载
After Effect 2024 最新中文版 for win 下载
android – 如何通过单击更改整个应用程序的语言?
我有一个Spinner,在登录页面上有三种语言选择.我想当用户选择一种语言时假设“波斯语”语言整个应用程序的语言应该改变.我只能更改当前活动的语言.如何更改整个应用程序的语言.
解决方法:
在Android中以编程方式更改语言
以下是更改应用程序区域设置的适当方法:
要以编程方式更改语言,必须克服一些困难.
1.)在配置更改期间关闭或重新创建后,您的应用程序将不会记住您的语言更改.
2.)您应该根据所选语言正确更新当前可见的UI.
解
“LocaleHelper”是您所需要的解决方案.您只需在应用程序的主类上初始化语言环境.之后,您的所有语言更改都将持续存在.
在Android API Version 24(Nougat)最近的更改之后,我们需要覆盖attachBaseContext以反映更改.
以下方法用于更改应用程序的语言:
private static boolean updateResources(Context context, String language) {
Locale locale = new Locale(language);
Locale.setDefault(locale);
Resources resources = context.getResources();
Configuration configuration = resources.getConfiguration();
configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getdisplayMetrics());
return true;
}
在以下链接中查找更多详情:
Changing Android’s Locale Programmatically
android-如何更改整个应用程序语言?
这个问题已经在这里有了答案: > Change app language programmatically in Android 30个
我正在制作一个想要在其中显示语言选择页面的页面的应用程序.到目前为止,我已将英语,北印度语和马拉地语包括在内,并将英语设置为默认值.
我的问题是:
>如何在“所选语言”中更改整个应用程序语言?
>选择语言后,每当我重新打开应用程序时,它就会使用先前选择的语言?
解决方法:
将所有文本放入字符串文件.为每种语言创建单独的字符串文件(Deutsch values-de / strings.xml,法语values-fr / strings.xml)
并且当您需要更改语言调用跟踪功能时.对于英语,将“ en”设置为另一组对应的键
科特林
val config = resources.configuration
val locale = Locale("en")
Locale.setDefault(locale)
config.locale = locale
resources.updateConfiguration(config, resources.displayMetrics)
Android Java
Configuration config = GetBaseContext().getResources().getConfiguration();
Locale locale = new Locale("en");
Locale.setDefault(locale);
config.locale = locale;
GetBaseContext().getResources().updateConfiguration(config,
GetBaseContext().getResources().getdisplayMetrics());
android-如何更改日历视图的语言?
我使用了View Calendar Spanish,但是我不确定如何更改语言,有些属性在任何地方都不可用.
现在我有这个:
<CalendarView
android:id="@+id/calendari"
android:layout_margin="10dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weekNumberColor="@color/botoCalendari"
android:focusedMonthDateColor="#d91f1f"
android:weekSeparatorLineColor="#1fd928"
android:selectedWeekBackgroundColor="#1fd9d6"
android:unfocusedMonthDateColor="#d91fd9"
/>
是否有任何属性或代码?
非常感谢你.
解决方法:
这可能对您有帮助.
import android.app.Activity;
import android.content.res.Configuration;
import android.os.Bundle;
public class Main extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String languagetoLoad = "fa"; // your language
Locale locale = new Locale(languagetoLoad);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
getBaseContext().getResources().updateConfiguration(config,
getBaseContext().getResources().getdisplayMetrics());
this.setContentView(R.layout.main);
}
}
您找到示例here
我们今天的关于如何更改 moment.js 的语言?和moment-with-locales.js的分享已经告一段落,感谢您的关注,如果您想了解更多关于After Effect 切换中英文教程 AE 软件如何更改语言?、android – 如何通过单击更改整个应用程序的语言?、android-如何更改整个应用程序语言?、android-如何更改日历视图的语言?的相关信息,请在本站查询。
本文标签: