- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想使用 VS Code 在我的 asp.net 项目中创建一个国际化文件。我刚刚发现如何使用常见的 VS 版本来做到这一点,只需创建一个 .resx 文件,然后使用特定的界面来插入变量和值。
如何使用 Visual Studio Code 创建国际化文件?
最佳答案
Visual Studio Code 不是 IDE。这是一个代码编辑器。因此,您不能像使用完整的 Visual Studio 获得该菜单那样添加新的项目类型。相反,您可以添加文本文件,给它们适当的扩展名,然后相应地填写它们。
资源文件是 .resx,这是您可以使用的使用 Visual Studio Community 制作的入门文件:
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="MyString" xml:space="preserve">
<value>My Value</value>
<comment>My Comment</comment>
</data>
</root>
关于c# - 使用 asp.net、c# 和 VSCode 进行国际化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33070847/
我有一个 Java 字符串,但在处理时遇到了问题。我有一个字符串 s,它的值为丞(我随机选择的一个汉字,我不会说中文)。如果我打电话 String t = new String(s.getBytes(
在Qt中,所有的输入部件和文本绘制方式对Qt支持的所有语言都提供了内置的支持。Qt内置的字体引擎可以在同一时间正确而且精细地绘制不同的文本,这些文本可以包含来自众多不同书写系统的字符。如果想了解更多的
如何实现字段标签、帮助文本等的国际化支持。字段的标准乘法似乎不起作用例如文档中给出的用于创建联系表单的示例。我尝试为其他语言添加额外的字段(文档中描述的第一种方法) from django.db
是否有可能当我在操作类中使用“getText(”keyName”); 时,我可以指定仅从 ENGLISH 资源包中选择值。因为我只想将此值用于日志记录目的。 任何想法我怎么能做到这一点? BR 标准委
我有一些关于 GWT 的国际化解决方法的问题。 1) 处理直接写入 ui.xml 文件的静态文本的最佳方式是什么? 目前,我正在使用 Messages-Interface 来翻译 Java 生成的文本
我在 Symfony 2 中遇到了一个奇怪的翻译问题。 这是我的config.yml imports: - { resource: parameters.yml } - { resou
对于我的大部分应用程序,我可以使用 https://developers.google.com/web-toolkit/doc/latest/DevGuideI18n 中列出的推荐国际化技术。 (主要
我使用 Android Studio 创建了一个新的 Flutter 项目。我正在使用null-safety,并且正在物理设备上运行应用程序,但代码生成无法正常工作,没有flutter_gen.dar
这里是菜鸟。 我正在尝试对基于命令行的程序实现国际化。以下是 java 国际化路径中可用的内容。 import java.util.*; public class I18NSample { s
我使用 Android Studio 创建了一个新的 Flutter 项目。我正在使用null-safety,并且正在物理设备上运行应用程序,但代码生成无法正常工作,没有flutter_gen.dar
我正在开发一个需要多语言的应用程序。 我正在尝试关注 this国际化教程。但是,当我尝试“使用基本国际化”时, View 中没有列出我的 Storyboard。 我正在使用 XCode 4.6.3 我
我住在印度(有超过20种语言)我正在尝试在网站中实现java国际化。 但是在 Locale.getAvailableLocales() 中,本地语言不可用。我的情况是否可以实现国际化? 如果可能的话字
我有以下 SDN 4 实体: 决策、特征和值: @NodeEntity public class Value { private final static String SET_FOR = "
关于MySql,是否有支持所有或绝大多数语言的字符集? 最佳答案 统一码。它有几种编码:UTF-8、UTF-16 和 UTF-32。 来自 http://en.wikipedia.org/wiki/U
我目前正在使用 Vuepress。但是我想要在我的 Vuepress 站点中使用多种语言。经过 3 天的挣扎,我决定把我的问题放在这里。 (是的,我查看了 Vuepress 文档:https://vu
我需要返回一个 strftime() 调用,该调用使用与我本地机器/操作系统上设置的语言不同的语言。是否可以选择返回语言? 最佳答案 对于可靠的 i18n/L10N,可由必须在同一运行中提供不同本地化
我有一些按钮,按下它们后我想播放一些音频。按钮的名称是音频文件的名称 private func playAudio(title : String){ audioPlayer = AVAudio
如何更改 HTML5 的消息(或者它会根据浏览器的语言自动更改?) 例如: E-mail: 当我在 Opera 运行此代码(来自 W3schools)
我发现很多关于 url schemes 的话题,最常见的是: www.mysite.com/fr/products www.mysite.com/en/products www.mysite.com/
在 Android WebView 中处理国际化/本地化的最佳方式是什么。理想情况下,我想访问以下位置的所有字符串资源: res/values/strings.xmlres/values-de/str
我是一名优秀的程序员,十分优秀!