提交一个工具ToUppercaseUtil,该工具主要的作用为将message_zh_CN.properties中的小写ascii码替换为大写

This commit is contained in:
wangxin
2018-06-28 15:02:58 +08:00
parent 8e98788744
commit 07d998eea1
4 changed files with 865 additions and 655 deletions

View File

@@ -0,0 +1,78 @@
/**
*@Title: ToUppercaseUtil.java
*@Package com.nis.util
*@Description TODO
*@author dell
*@date 2018年6月28日 下午1:39:46
*@version 版本号
*/
package com.nis.util;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @ClassName: ToUppercaseUtil.java
* @Description: 替换message_zh_CN.properties的ascii符号由小写至大写
* @author (wx)
* @date 2018年6月28日 下午1:39:46
* @version V1.0
*/
public class ToUppercaseUtil {
public static void main(String[] args) {
File file=new File("C:/Users/dell/git/gwall/src/main/resources/messages/message_zh_CN.properties");
try {
RandomAccessFile raf=new RandomAccessFile(file, "rw");
long lastPoint=0;
String line=null;
while((line=raf.readLine())!=null){
if(line.startsWith("#")){
lastPoint=raf.getFilePointer();
continue;
}else{
if(StringUtils.isNotBlank(line)){
String oldline=line;
String[] split=line.split("=");
String expression="\\\\u[0-9a-f]{4}";
Pattern p=Pattern.compile(expression);
Matcher matcher=p.matcher(split[1]);
while(matcher.find()){
String ascii=matcher.group();
String newAscii="\\u"+ascii.substring(2).toUpperCase();
if(!ascii.equals(newAscii)){
line=line.replace(ascii, newAscii);
}
}
final long point=raf.getFilePointer();
if(line.equals(oldline)){
lastPoint=point;
continue;
}else{
raf.seek(lastPoint);
System.out.println("replace "+oldline+" with "+line);
raf.write(line.getBytes());
lastPoint=point;
}
}else{
lastPoint=raf.getFilePointer();
continue;
}
}
}
raf.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

View File

@@ -407,6 +407,7 @@ count=count
name_image=name image name_image=name image
organizer=organizer organizer=organizer
save_organization=save organization save_organization=save organization
success=success
password=password password=password
nochange_blank=please fill blank if you have no change nochange_blank=please fill blank if you have no change
confirm_password=confirm password confirm_password=confirm password
@@ -493,7 +494,6 @@ area_code=area code
area_type=area type area_type=area type
longitude=longitude longitude=longitude
latitude=latitude latitude=latitude
role_list=role list role_list=role list
role_allot=role allot role_allot=role allot
staff_list=staff list staff_list=staff list

View File

@@ -366,6 +366,139 @@ input_protocol_id=please enter protocol ID
input_integer=please enter right integer input_integer=please enter right integer
protocol_desc=protocol description protocol_desc=protocol description
#==========tedingfuwu end===================== #==========tedingfuwu end=====================
#==========xitongguanli begin======================
owner_company=owner company
company=company
owner_group=owner group
group=group
template=template
export=export
import=import
sure_export=Do you confirm the export data
sure_delete=Do you confirm the delete data
login_name=login name
name=name
identify_mark=identify mark
mail=mail
role=role
manager=manager
ordinary_man=ordinary man
nextPage=next Page
previousPage=previous Page
total=total
current=current
page=page
count=count
name_image=name image
organizer=organizer
save_organization=save organization
success=success
password=password
nochange_blank=please fill blank if you have no change
confirm_password=confirm password
manager_info=the manager needs to specify the identity as the "manager",otherwise the audit process will be affected!
name_existed=name existed
company_range=The department does not belong to the company
equal_password=Please enter the same password as above
choose_org=choose organization
org_name=organization name
belong_area=belong area
org_coding=organization coding
level=level
org_type=organization type
org_duty_type=organization duty type
add_level=add level
delete_all_child=Do you want to delete this and all level
parent_org=parent organization
org_level=organization level
is_useable=whether useable
is_useable_info="Yes" indicates that the account is allowed to login and "No" is not.
leader=leader
vice_leader=vice leader
address=address
master=master
post_code=post code
phone=phone
fax=fax
nochange=no edit record
module_name=module name
dict_mark=dict mark
run_state=running state
mark=mark
value=value
is_maintain=whether maintain
last_edit_time=last edit time
dict_edit_record=dict edit record
dict_detail=dict detail
edit_record=edit record
edit_record_view=edit record view
dict_edit_info=dictionary is very import in the system,Do you decide to edit?
dict_delete_info=dictionary is very import in the system,Do you decide to delete?
dict_saveitem_error=save message error,enter a entry!
dict_saveitem_nullerror=Save info error,every entry and value can not be empty!
submit_error=configuration submit error,please look at the error info!
form_validate=form validate success
entry=entry
add_entry=add entry
maintainable=maintainable
useable=useable
click_add=click add
menu_name=menu name
unicode=unicode
link=link
visible=visible
permission_mark=permission mark
display=display
hide=hide
add_child_menu=add child menu
save=save
save_sort=save sort
menu=menu
parent_menu=parent menu
aim=aim
click_menu_turn=the page of click the menu
link_window_info=the aim window of the link,default:mainFrame
is_top_menu=whether the top menu
icon=icon
is_top_menu_info=Is the menu or operation the top navigation menu?
sort_info=order by asc
is_show_sysmenu=Is the menu or operation displayed in the system menu?
control_permission_info=Permission identity defined in the controller,for example:@RequiresPermissions("permission mark")
role_name=role name
data_range=data range
allot=allot
role_type=role type
role_permission=role permission
task_allot=task allot
role_type_title=activiti\u67093\u79CD\u9884\u5B9A\u4E49\u7684\u7EC4\u7C7B\u578B\:security-role,assignment,user \u5982\u679C\u4F7F\u7528Activiti Explorer,\u9700\u8981security-role\u624D\u80FD\u770B\u5230manage\u9875\u7B7E,\u9700\u8981assignment\u624D\u80FDclaim\u4EFB\u52A1
role_type_info=workflow group user type(task allocation:assignment,management role:security-role,ordinary role:user)
data_range_info=in special cases,\u8BBE\u7F6E\u4E3A"\u6309\u660E\u7EC6\u8BBE\u7F6E",\u53EF\u8FDB\u884C\u8DE8\u673A\u6784\u6388\u6743
permission_list=permission list
area_name=area name
area_code=area code
area_type=area type
longitude=longitude
latitude=latitude
role_list=role list
role_allot=role allot
staff_list=staff list
choose_and_allot=By selecting department,we assign roles to the listed people.
loading=loading...
remove=remove
sure_remove_role= role will be removed from this user?
system_prompt=system prompt
old_password=old password
new_password=new password
sure_new_password=confirm new password
be_selected_staff=be selected staff
selected_staff=selected staff
old_remove_error=old role can be removed!
selected_clear_success=selected staff clear success!
cancel_clear=cancel clear!
sure_clear=clear
role_no_new=role dont have new staff!
#==========xitongguanli end======================
#===============multiole cfg start==================== #===============multiole cfg start====================
optional=optional optional=optional
custom_region=custom region custom_region=custom region

File diff suppressed because it is too large Load Diff