中文翻译成英文 ant

Antd日期组件汉化踩坑实录:为什么ConfigProvider+dayjs配置后还是英文? 本文深入解析Ant Design日期组件汉化失效问题,提供从依赖检查到多场景解决方案的完整指南。重点讲解ConfigProvider与dayjs的正确配置方法,解决中文显示英文的常见问题,帮助开发者高效实现Antd组件本地化。 阅读详情

Properties are an important way to customize a build process or to just provide shortcuts for strings that are used repeatedly inside a build file.

 

In its most simple form properties are defined in the build file (for example by the property task) or might be set outside Ant. A property has a name and a value; the name is case-sensitive. Properties may be used in the value of task attributes or in the nested text of tasks that support them. This is done by placing the property name between "${" and "}" in the attribute value. For example, if there is a "builddir" property with the value "build", then this could be used in an attribute like this: ${builddir}/classes. This is resolved at run-time as build/classes.

 

With Ant 1.8.0 property expansion has become much more powerful than simple key value pairs, more details can be found in the concepts section of this manual.

 

Example Buildfile

 

<project name="MyProject" default="dist" basedir=".">

    <description>

        simple example build file

    </description>

  <!-- set global properties for this build -->

  <property name="src" location="src"/>

  <property name="build" location="build"/>

  <property name="dist"  location="dist"/>

 

  <target name="init">

    <!-- Create the time stamp -->

    <tstamp/>

    <!-- Create the build directory structure used by compile -->

    <mkdir dir="${build}"/>

  </target>

 

  <target name="compile" depends="init"

        description="compile the source " >

    <!-- Compile the java code from ${src} into ${build} -->

    <javac srcdir="${src}" destdir="${build}"/>

  </target>

 

  <target name="dist" depends="compile"

        description="generate the distribution" >

    <!-- Create the distribution directory -->

    <mkdir dir="${dist}/lib"/>

 

    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->

    <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>

  </target>

 

  <target name="clean"

        description="clean up" >

    <!-- Delete the ${build} and ${dist} directory trees -->

    <delete dir="${build}"/>

    <delete dir="${dist}"/>

  </target>

</project>

Notice that we are declaring properties outside any target. As of Ant 1.6 all tasks can be declared outside targets (earlier version only allowed <property>,<typedef> and <taskdef>). When you do this they are evaluated before any targets are executed. Some tasks will generate build failures if they are used outside of targets as they may cause infinite loops otherwise (<antcall> for example).

 

We have given some targets descriptions; this causes the projecthelp invocation option to list them as public targets with the descriptions; the other target is internal and not listed.

 

Finally, for this target to work the source in the src subdirectory should be stored in a directory tree which matches the package names. Check the <javac> task for details.

 

Token Filters

 

A project can have a set of tokens that might be automatically expanded if found when a file is copied, when the filtering-copy behavior is selected in the tasks that support this. These might be set in the buildfile by the filter task.

 

Since this can potentially be a very harmful behavior, the tokens in the files must be of the form @token@, where token is the token name that is set in the <filter> task. This token syntax matches the syntax of other build systems that perform such filtering and remains sufficiently orthogonal to most programming and scripting languages, as well as with documentation systems.

 

Note: If a token with the format @token@ is found in a file, but no filter is associated with that token, no changes take place; therefore, no escaping method is available - but as long as you choose appropriate names for your tokens, this should not cause problems.

 

Warning: If you copy binary files with filtering turned on, you can corrupt the files. This feature should be used with text files only.

 

Path-like Structures

 

You can specify PATH- and CLASSPATH-type references using both ":" and ";" as separator characters. Ant will convert the separator to the correct character of the current operating system.

 

Wherever path-like values need to be specified, a nested element can be used. This takes the general form of:

 

    <classpath>

      <pathelement path="${classpath}"/>

      <pathelement location="lib/helper.jar"/>

    </classpath>

The location attribute specifies a single file or directory relative to the project's base directory (or an absolute filename), while the path attribute accepts colon- or semicolon-separated lists of locations. The path attribute is intended to be used with predefined paths - in any other case, multiple elements with location attributes should be preferred.

 

Since Ant 1.8.2 the location attribute can also contain a wildcard in its last path component (i.e. it can end in a "*") in order to support wildcard CLASSPATHs introduced with Java6. Ant will not expand or evaluate the wildcards and the resulting path may not work as anything else but a CLASSPATH - or even as a CLASSPATH for a Java VM prior to Java6.

 

As a shortcut, the <classpath> tag supports path and location attributes of its own, so:

 

    <classpath>

      <pathelement path="${classpath}"/>

    </classpath>

can be abbreviated to:

 

    <classpath path="${classpath}"/>

In addition, one or more Resource Collections can be specified as nested elements (these must consist of file-type resources only). Additionally, it should be noted that although resource collections are processed in the order encountered, certain resource collection types such as fileset, dirset and files are undefined in terms of order.

 

    <classpath>

      <pathelement path="${classpath}"/>

      <fileset dir="lib">

        <include name="**/*.jar"/>

      </fileset>

      <pathelement location="classes"/>

      <dirset dir="${build.dir}">

        <include name="apps/**/classes"/>

        <exclude name="apps/**/*Test*"/>

      </dirset>

      <filelist refid="third-party_jars"/>

    </classpath>

This builds a path that holds the value of ${classpath}, followed by all jar files in the lib directory, the classes directory, all directories named classes under the apps subdirectory of ${build.dir}, except those that have the text Test in their name, and the files specified in the referenced FileList.

 

If you want to use the same path-like structure for several tasks, you can define them with a <path> element at the same level as targets, and reference them via their id attribute--see References for an example.

 

By default a path like structure will re-evaluate all nested resource collections whenever it is used, which may lead to unnecessary re-scanning of the filesystem. Since Ant 1.8.0 path has an optional cache attribute, if it is set to true, the path instance will only scan its nested resource collections once and assume it doesn't change during the build anymore (the default for cache still is false). Even if you are using the path only in a single task it may improve overall performance to set cache to true if you are using complex nested constructs.

 

A path-like structure can include a reference to another path-like structure (a path being itself a resource collection) via nested <path> elements:

 

    <path id="base.path">

      <pathelement path="${classpath}"/>

      <fileset dir="lib">

        <include name="**/*.jar"/>

      </fileset>

      <pathelement location="classes"/>

    </path>

 

    <path id="tests.path" cache="true">

      <path refid="base.path"/>

      <pathelement location="testclasses"/>

    </path>

The shortcuts previously mentioned for <classpath> are also valid for <path>.For example:

    <path id="base.path">

      <pathelement path="${classpath}"/>

    </path>

can be written as:

    <path id="base.path" path="${classpath}"/>

Path Shortcut

 

In Ant 1.6 a shortcut for converting paths to OS specific strings in properties has been added. One can use the expression ${toString:pathreference} to convert a path element reference to a string that can be used for a path argument. For example:

 

  <path id="lib.path.ref">

    <fileset dir="lib" includes="*.jar"/>

  </path>

  <javac srcdir="src" destdir="classes">

    <compilerarg arg="-Xbootclasspath/p:${toString:lib.path.ref}"/>

  </javac>

Command-line Arguments

 

Several tasks take arguments that will be passed to another process on the command line. To make it easier to specify arguments that contain space characters, nested arg elements can be used.

 

Attribute Description Required

value a single command-line argument; can contain space characters. Exactly one of these.

file The name of a file as a single command-line argument; will be replaced with the absolute filename of the file.

path A string that will be treated as a path-like string as a single command-line argument; you can use ; or : as path separators and Ant will convert it to the platform's local conventions.

pathref Reference to a path defined elsewhere. Ant will convert it to the platform's local conventions.

line a space-delimited list of command-line arguments.

prefix A fixed string to be placed in front of the argument. In the case of a line broken into parts, it will be placed in front of every part. Since Ant 1.8. No

suffix A fixed string to be placed immediately after the argument. In the case of a line broken into parts, it will be placed after every part. Since Ant 1.8. No

It is highly recommended to avoid the line version when possible. Ant will try to split the command line in a way similar to what a (Unix) shell would do, but may create something that is very different from what you expect under some circumstances.

 

Examples

 

  <arg value="-l -a"/>

is a single command-line argument containing a space character, not separate commands "-l" and "-a".

 

  <arg line="-l -a"/>

This is a command line with two separate arguments, "-l" and "-a".

 

  <arg path="/dir;/dir2:/dir3"/>

is a single command-line argument with the value /dir;/dir2;/dir3 on DOS-based systems and /dir:/dir2:/dir3 on Unix-like systems.

 

References

 

Any project element can be assigned an identifier using its id attribute. In most cases the element can subsequently be referenced by specifying the refid attribute on an element of the same type. This can be useful if you are going to replicate the same snippet of XML over and over again--using a <classpath> structure more than once, for example.

 

The following example:

 

<project ... >

  <target ... >

    <rmic ...>

      <classpath>

        <pathelement location="lib/"/>

        <pathelement path="${java.class.path}/"/>

        <pathelement path="${additional.path}"/>

      </classpath>

    </rmic>

  </target>

 

  <target ... >

    <javac ...>

      <classpath>

        <pathelement location="lib/"/>

        <pathelement path="${java.class.path}/"/>

        <pathelement path="${additional.path}"/>

      </classpath>

    </javac>

  </target>

</project>

could be rewritten as:

 

<project ... >

  <path id="project.class.path">

    <pathelement location="lib/"/>

    <pathelement path="${java.class.path}/"/>

    <pathelement path="${additional.path}"/>

  </path>

 

  <target ... >

    <rmic ...>

      <classpath refid="project.class.path"/>

    </rmic>

  </target>

 

  <target ... >

    <javac ...>

      <classpath refid="project.class.path"/>

    </javac>

  </target>

</project>

All tasks that use nested elements for PatternSets, FileSets, ZipFileSets or path-like structures accept references to these structures as shown in the examples. Using refid on a task will ordinarily have the same effect (referencing a task already declared), but the user should be aware that the interpretation of this attribute is dependent on the implementation of the element upon which it is specified. Some tasks (the property task is a handy example) deliberately assign a different meaning to refid.

 

Use of external tasks

 

Ant supports a plugin mechanism for using third party tasks. For using them you have to do two steps:

place their implementation somewhere where Ant can find them

declare them.

Don't add anything to the CLASSPATH environment variable - this is often the reason for very obscure errors. Use Ant's own mechanisms for adding libraries:

via command line argument -lib

adding to ${user.home}/.ant/lib

adding to ${ant.home}/lib

For the declaration there are several ways:

declare a single task per using instruction using <taskdef name="taskname" classname="ImplementationClass"/> 

<taskdef name="for" classname="net.sf.antcontrib.logic.For" /> <for ... />

declare a bundle of tasks using a properties-file holding these taskname-ImplementationClass-pairs and <taskdef> 

<taskdef resource="net/sf/antcontrib/antcontrib.properties" /> <for ... />

declare a bundle of tasks using a xml-file holding these taskname-ImplementationClass-pairs and <taskdef> 

<taskdef resource="net/sf/antcontrib/antlib.xml" /> <for ... />

declare a bundle of tasks using a xml-file named antlib.xml, XML-namespace and antlib: protocoll handler 

<project xmlns:ac="antlib:net.sf.antconrib"/> <ac:for ... />

If you need a special function, you should

have a look at this manual, because Ant provides lot of tasks

have a look at the external task page in the manual (or better online)

have a look at the external task wiki page

ask on the Ant user list

implement (and share) your own

水下探测小白必看:单波束vs多波束声呐,5分钟搞懂核心区别 本文为水下探测新手清晰解析了单波束与多波束声呐的核心区别。单波束声呐如同精准的“手电筒”,进行逐点扫描,适用于定点测深和目标探测;而多波束声呐则像“聚光灯”,能一次性覆盖一个扇区,高效获取海底地形三维信息,是海底测绘和水下三维建模的理想选择。文章通过生动的比喻和对比表格,帮助读者快速理解两者原理、效率差异及适用场景。 阅读详情

相关推荐

Apollo control模块横向控制原理及核心代码逐行解析

看完这篇文章,你会对apollo横向控制有一个整体的概念

weixin_39199083的博客 2万+

java错误提示------ The public type must be defined in its own file

The public type must be defined in its own file 翻译:公共类必须被定义在它自己的文件中 产生错误的原因: 1.定义Java类名同文件名不一样 2.一个文件中有多个类,只有与文件名一致的类名,才能声明为:public 内部类不能声明为:public 一个文件中只能有一个public类

H002399的专栏 2万+

中孚保密检查系统彻底卸载指南:绕过口令与清除内核残留

中孚保密检查系统是深度集成于Windows内核的合规管控软件,其卸载涉及用户态口令校验、内核态服务引擎与Ring 0级驱动自保三重机制。理解其基于SHA-256哈希的本地口令验证原理和zfsysflt.sys过滤驱动的加载逻辑,是实现无残留清理的技术前提。该系统具备高权限驻留特性,常规卸载工具无法触达驱动与服务层,易引发蓝屏、启动缓慢及新安全软件冲突等工程问题。典型应用场景包括涉密终端批量清退、安全研究环境重建及误装后紧急退出。本文聚焦‘口令绕过+手动清理’双轨方案,覆盖注册表、服务、驱动、文件与计划任务五

weixin_33508411的博客 1007

JAVA中 错误代码是 the public type must be defined in its own file 解决方法 android开发 java编程...

一般是由于定义的JAVA类同文件名不一致;  解决方法:  1、把文件名修改同XYZ一样的名字;  2、把类名修改成同文件名;

技术博客 4022

OsgEarth开发笔记(三):Osg3.6.3+OsgEarth3.1+vs2019x64开发环境搭建(下)

上一篇编译了proj6.2.0、gdal3.2.1,本篇继续。 OsgEarth的编译,是基于Osg和OsgEarth结合在一起的,先要编译Osg,然后编译OsgEarth。OsgEarth的依赖库较多,分为上、中、下三篇,然后单独有一篇如何将编译好的osgEarth集成到Qt中。

长沙红胖子 Qt・西安|省级科研团队从业背景,深耕双一流体系高精尖技术配套研发|剥离高精尖机理,沉淀高端特种行业领域 Qt 工程化落地经验|博文仅分享通用技术总结,输出公开普适工程思路。 4万+

第10章: MMU notifier与HMM的协作

本文摘要: HMM(Heterogeneous Memory Management)是Linux内核提供的异构内存管理框架,用于统一CPU与设备(如GPU、DSP等)的内存访问。它通过镜像页表技术实现虚拟地址空间共享,自动同步CPU和设备页表变化,支持透明的内存迁移和设备内存管理。HMM构建在mmu_interval_notifier机制上,利用序列号检测页表修改冲突,提供高效并发控制。核心数据结构包括hmm_range和HMM PFN标志位,通过hmm_range_fault()实现页表遍历和缺页处理。

图形/计算GPU的驱动与虚拟化技术分享园地 3095

编写Java出现“The public type tect must be defined in its own file”

文件名与公共类名一致时,开发者能快速判断文件内容的核心功能(如User.java必然包含public class User),提升代码结构的清晰度和可维护性。方法二:将公共类名 (本题为text) 重命名( 本题为text改为Time),确保类名与文件名(本题文件名为 Time.java)匹配。编译器通过文件名定位类的定义,若公共类名与文件名不匹配,会直接编译报错,确保类文件与源文件的对应关系明确。Java 语言规范强制要求公共类命名与文件名统一,以确保代码风格的一致性。2.代码可读性与规范。

2303_79975149的博客 620

AI训练师三级考证避坑指南|假证辨别+机构套路+OSTA验证

这是最基础的问题,也是最容易忽略的问题。人工智能训练师三级证书本身是有价值的——政府认可的职业技能等级证书、多地紧缺工种补贴、人才引进加分。但正因为有价值,才引来了大量骗子。记住三句话OSTA查不到的证,一分钱都不值声称免考包过的,100%是骗子培训费一次性谈清楚,后续加价直接走人如果你正在考虑考人工智能训练师三级证书,想要从报名到备考到拿证的完整一站式指南,欢迎查看我的付费专栏:📖《人工智能训练师三级·从零到拿证完全指南》99篇系统化内容,覆盖报名、备考、冲刺、拿证全流程。

白话机器学习 1219

错误提示----The public type must be defined in its own file

出现The public type c must be defined in its own file这个问题,是由于定义的JAVA类同文件名不一致;   解决方法:   1、把文件名修改同公共类一样的名字;   2、把类名修改成同文件名;   3.子类继承父类时,不需要再用public修饰   ~一个文件中有多个类,只有与文件名一致的类名,才能声明为:public 内部类不能声明为:public 一个文件中只能有一个public类 转载自此 ...

Kerryliuyue的博客 1万+

3. 动手运行第一个 SAP Fiori Elements 应用(ListReport 类型)

这个代理服务器能够自动监听我们 Fiori Elements 应用里向 ES5 Demo 系统发送的 OData 请求,拦截这个请求,并通过 Node.js 代码向 ES5 服务器转发,拿到响应数据后再交还给 Fiori Elements 应用。后者对自己发出的请求被代理这件事情一无所知。本文的任务是,大家按照我的介绍,在本地成功运行笔者准备的这个 Fiori Elements 应用。的错误消息, 说明大家安装的 Node.js 版本没有达到本地运行 Fiori Elements 的最低要求。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 1671

SolidWorks 小车底盘 装配体

通过制作小车底盘了解solidworks装配体的部分知识

及时总结 2228

【转】JAVA错误:The public type *** must be defined in its own file***

  出现The public type xxx must be defined in its own file这个问题,是由于定义的JAVA类同文件名不一致。public类必须定义在它自己的文件中。   解决方法:   1、把文件名修改同公共类一样的名字;   2、把类名修改成同文件名;   3、子类继承父类时,不需要再用public修饰。   同一文件中,不能有多于一个pub...

weixin_30682127的博客 2461

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

ant man 什么意思_钢铁侠的直译应该叫什么?英文本身是没有侠这种概念的吧?...

说起钢铁侠大家一定不陌生了,要说现在漫威最受欢迎的英雄,那一定就是钢铁侠了,这不仅仅是因为钢铁侠本身就极具科幻色彩,而且十分帅气,更重要的是小罗伯特唐尼的演绎使钢铁侠这一角色更加深入人心。但是大家一定有过一个疑问,为什么“iron man”的中文翻译是钢铁侠呢?如果钢铁侠的名字选择直译,应该叫什么呢?毕竟“man”本身没有侠的意思,也没有这种概念,接下来我们就干货走一波。首先我们来看一下“iron...

weixin_39715907的博客 826

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

Ant Design国际化深度解析

本文详细介绍了Ant Design的国际化(i18n)功能,包括其核心概念、应用场景和实现方法。国际化不仅涉及多语言文本翻译,还包含日期格式、数字显示和布局方向等本地化适配。文章提供了基础配置示例、语言切换实现方案和自定义翻译内容的方法,并推荐了分层管理翻译资源和动态加载等最佳实践。通过对比Ant Design与React-Intl、i18next等方案的优缺点,帮助开发者根据项目需求选择合适的国际化方案。最后强调,良好的国际化实现能为全球用户提供自然流畅的产品体验。

leohu0723的博客 349

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

如何在 Ant Design Pro 中集成 react-i18next:企业级中后台国际化终极指南

在当今全球化的商业环境中,企业级中后台系统的国际化需求日益增长。react-i18next 作为 React 生态中最强大的国际化解决方案,与 Ant Design Pro 的完美结合,为开发者提供了完整的国际化工作流。 ## 🌍 为什么选择 react-i18next 进行国际化? react-i18next 基于 i18next 生态系统,为 React 应用提供了无缝的国际化体验。与

gitblog_00488的博客 1074

vue3+antd-design-vue语言国际化配置

1.安装antd-design-vue 时使用npm i --save ant-design-vue@next命令,(文末会贴出相关框架版本); 2.语言国际化配置分为两种,第一种是我们自定义组件使用到的文字,第二种是ui框架自带的文字。 思路:自定义文字可动态匹配,ui框架上的可采用它自带的国际化配置 文件结构 新建语言包文件: zh_CN.ts // 中文翻译 export default { title: "国际化语言配置", btn: "按钮", add: "添加", del:

weixin_44136421的博客 4412

分享文档浏览网站 Docs4dev

作为一个程序员,每天最多打交道的肯定是代码,其次就是各种开源框架的文档了,但是各个框架的文档都有它们自己的风格,在国内某些网站的打开速度也是堪忧,最重要的是:大部分文档都不支持搜索,也不支持中文,基于此,我开发了一个文档网站:https://www.docs4dev.com ,它使用了 ant-design 作为 UI 框架,不管是加载速度还是 UI 样式都十分美观;其次,它使用了 Elasti...

github_39939645的博客 765

Android开发环境配置简介

本文介绍了Android开发环境配置时需要了解的事项。Android开发环境目前只支持XP(32-bit)、Vista(32/64-bit)、Mac OS X 10.4.8或更新版本(x86)、Linux,本文建议使用Eclipse进行开发。 写这个系列的原因也是因为自己对android比较感兴趣,而网上多数教程都是直接参照官方翻译,并且翻译质量也不是很好,因为有些东西看去还真是英文能理解,中文翻译的反而不伦不类。我不是说我英文水平有多好,所以我也不会去做翻译,我只会把我学习进度过程做记录,和大家一起分享

开发简记 777

msclass 文字滚动_js文字横向滚动

iScroll.js 用法参考 (share)分享是传播、学习知识最好的方法以下这篇文章是iScroll.js官网的中文翻译,尽管自己英文不好,但觉得原作者们翻译的这个资料还是可以的,基本用法介绍清楚了。如果你英文比较好的话,可以看看官网的资料。参考:http://www.cnblogs.com/asqq/archive/2012/04/...文章最美的回忆2017-11-281197浏览量iSc...

weixin_35932973的博客 267

关于FAR文件

 关于FAR文件 你可以把FAR文件放置在一个应用程序的两个位置中:一个是应用程序目录,一个是脚本库路径。 如果你把FAR文件放置在应用程序目录中,则FAR的名字必须是main.far或.far,在这里是应用程序目录的名字。 例如,如果一个应用程序位于C:/samples/foo,则你可以把所有来自应用程序文件夹的必需的脚本文件打包成main.far或.far并把它放置在C:/

Bill的专栏 3011

FMS 学习札记

关于FAR文件 你可以把FAR文件放置在一个应用程序的两个位置中:一个是应用程序目录,一个是脚本库路径。 如果你把FAR文件放置在应用程序目录中,则FAR的名字必须是main.far或<appname>.far,在这里 <appname>是应用程序目录的名字。 例如,如果一个应用程序位于C:/samples/foo,则你可以把所有来自应用程序文件夹的必需的...

weixin_30618985的博客 91
上一篇: ant 简单应用
下一篇: jsoup
Hellowgy
博客等级 码龄18年 10粉丝 27原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值