博文

本地化,我来说(2014-04-22 23:53:00)

摘要:         本地化,2009 年 10 月 26 日至今,已经和我一起四年半时间了,这些日子从坎坷到平坦再到坎坷,作为一段历程,我想我也有资格说两句,仅发自内心地想说说。         我的本地化生涯伊始,跟着第一任组长 Michael Zhang 从零开始,慢慢接触了这个原本陌生的环境,一段时间后,基本了解了这个行业,或者说我自己,处在当前的位置渐渐清楚了需要做的东西,明白了一个本地化工程师的职责。起初的本地化只局限于 Trados,后来到了 World Server,等到 Michael 离职后,又有了 SDLX,按理说应该是有越来越充实的感觉,但随时间这么过,不但没有充实感,倒是更多了一份压抑和委身的感觉,觉得就像是在一个魔爪中。其实 Trados 被 SDL 收购前,它的开放文档格式 .ttx 已经很符合本地化的需求,并且针对这个格式开发出来的工具已经很能符合翻译需求,或者这是一个良好的利于翻译过程的格式,这种基于 XML 的格式无论任何方面都能被轻松接受,尤其是后来我加入到针对 .ttx 格式开发自动化脚本的过程后,我已然能体会到这种格式的优越性。但随着收购的完成,SDL 将 Trados 并入到一个集成翻译环境中,这就意味着这种开放的格式慢慢地被遗弃了,即便后来又有了高版本的 .sdlxliff 开放格式,我的感觉也只认为这只是一次不疼不痒的升级,纯粹是为了升级和垄断,号称免费的 SDK 也只能被注册用户拿到,这是翻译界的事,为什么要我注册?罢了,我还就不做有关 SDL 的自动化了。         现在,对于工具当然还是 SDL 的稍有优势,不过分,只是稍有,随着这款工具的不断升级,授权费用也越来越高,对于企业来说尚且需要衡量购买,更别说翻译了,在版权越来越被尊重的今天,盗版软件的使用越来越被行业所不齿,并且日常的本地化生产过程也因此严重受限。这种情况下,大部分本地化企业都在着手自己的本地化翻译流程化平台,基本都是基于开源翻译软件,如 OmegaT,在此基础上对功能进行扩展和完善。这样做的的坏处就是对于本地化这个行业来说,工具碎片化严重,难于制定行业规范,好处是避免了某......

阅读全文(9907) | 评论:3

Python 3 文件重命名(2012-08-02 17:36:00)

摘要: 一段 Python 3 编写的重命名脚本,仅用于文件,不包括文件夹,一般说来文件重命名更实用点儿,自己用自己的东西怎么都顺手,递归是好东西: import os import re def BatchRenameFile(string_path, string_old_name, string_new_name): # We need three parameters, the path contains all the files you want to rename, the regular expression strings for old and new names     re_old_name = re.compile(string_old_name) # re object compiled for match the files whose name need to be changed     string_contents = os.listdir(string_path) # List all files and sub folders in current folder     for string_content in string_contents: # For every object         if os.path.isdir(string_content): # If it's a folder, enter it and execute this method in it, when finish, go back to parent folder             os.chdir(string_content)             BatchRenameFile(os.getcwd(), string_old_name, string_new_name) &nb......

阅读全文(8563) | 评论:2

本地化的征途(2012-04-11 23:18:00)

摘要:       在发这篇文章之前,我也想了多少次该不该把“本地化”加到这个编程爱好者的地盘上来,而决定把它加进来之后,又想是不是应该为它单独建一个分类,结果我都这么做了。在我进入这个行业之前,真是一无所知,进门之后发现原来也是高利润产业,并且和 IT 息息相关,虽然不是短时间内认识到,但是依旧是认识到了,我想把我对这个行业的看法说说,有同行尽可能指正一下不妥之处,毕竟我的理解不代表大众。       本地化是运用各种计算机软件技术把各类可用于交流的文件格式多国语言化的一个行业:那不就是翻译吗?自从干上这个,我从未这样想过,因为身在其中,我的的确确知道我不是做翻译的,但是翻译是最重要的一个环节。本地化的最终目的就是把一种语言格式的文件翻译成其它一种或多种语言文件以使更多的人能够用自己精通的语言来学习和认知,其中最重要的就是翻译,这是本地化最核心的部分,翻译的质量决定着整个任务的成败,但是大多数情况下“翻译人员”并不是某一方面的专家,他们只懂语言而不懂要翻译的文件的背景和特殊之处,最要命的就是他们在大量的翻译任务面前需要并且只能使用快捷的计算机辅助翻译工具(CAT),而辅助工具并不能直接或者根本就不支持原始要翻译的文档的文档格式,所以在送给翻译之前,这些原始文档就需要通过某种手段转换为计算机辅助翻译工具所能处理的格式,而这些大量的多种多样的原始格式和单一的受限被支持文档格式之间就需要我们想办法转换一下,翻译前把原始文件转换为翻译工具支持的格式,翻译后再转换回原始的文件格式,正是由于原始文档的格式太多,几乎包括了所有包含可阅读信息的文件格式,所以需要有些人专注于文件格式转换方面的工作并保证转换的健康性和可靠性,而这些人就是“本地化工程师”。       通常所说的本地化工程师大多数情况下是指上面提到的这些专注于文件本身和之间联系的面向机器的人,还有一种是面向人文的,也就是“排版工程师”,他们的工作在社会上各个行业都应用广泛,类似于图文设计和版式调整。如果被翻译文档是最终供人们获取信息的,比如演示文稿、网页、广告页、宣传册、书籍,或者软件界面也算,那么我们就需要排版工程师对其进行版式调整,因为把一种语......

阅读全文(3366) | 评论:0

全排列(2011-01-13 22:25:00)

摘要:全排列的程序似乎很基础,不过乍一想还真有点儿想不通,防止忘记,存下来作为积累吧。#include<stdio.h> #define N 4 void swap(int *first, int *second) {int temp;  temp = *first;  *first = *second;  *second = temp; } void QuanPaiLie(int array[], int start, int end) {int current;  if(start > end)  {for(current = 0; current <= end; current ++) printf("%d ", array[current]);   printf("\n");  }  else  {for(current = start; current <= end; current ++)   {swap(&array[current], &array[start]);    QuanPaiLie(array, start + 1, end);    swap(&array[current], &array[start]);   }  } } void main(void) {int arraylist[N], iter;  printf("Please input %d numbers for test: ", N);  for(iter = 0; iter < N; iter ++)   scanf("%d", & arraylist[iter]);  printf("Now the result is:\n");  QuanPaiLie(arraylist, 0, N - 1); }......

阅读全文(4050) | 评论:0

C魔方矩阵(2008-09-04 22:46:00)

摘要:#include<stdio.h> void main(){int array[19][19],dimension,first,second,count=1; printf("Please input the dimension: "); scanf("%d",&dimension); first=0; second=dimension/2; for(;count<=dimension*dimension;count++) {array[first][second]=count;  if(count%dimension!=0)  {first=(dimension+first-1)%dimension;   second=(second+1)%dimension;  }  else if(count%dimension==0)first=first+1; } printf("\nThe array is:\n\n"); for(first=0;first<dimension;first++) {for(second=0;second<dimension;second++)  {printf("%4d",array[first][second]);  }  printf("\n"); } printf("\nEnter Key To Exit......"); getch();}......

阅读全文(7209) | 评论:1

C冒泡排序(2008-09-04 22:45:00)

摘要:#include<stdio.h> main(){int array[10],i,j,temp; printf("Please input 10 numbers to sort:\n"); for(i=0;i<10;i++)  scanf("%d",&array[i]); for(i=0;i<9;i++) {for(j=i+1;j<10;j++)  {if(array[j]<array[i])   {temp=array[i];    array[i]=array[j];    array[j]=temp;   }  } } printf("The numbers after sorting are:\n"); for(i=0;i<10;i++)  printf("%d ",array[i]); printf("\n"); getch();}......

阅读全文(5906) | 评论:0

布局和事件(2007-12-22 21:16:00)

摘要:一个简单的布局和时间的组合程序,没什么可借鉴的的地方,只是作为曾经做过的一个标志。 import java.awt.*;import java.awt.event.*;import javax.swing.*; public class Copy extends JFrame implements ActionListener{JPanel p1,p2;TextField t1,t2;Label l1,l2;JButton b1,b2; public static void main(String args[]) {new Copy(); } Copy() {addWindowListener(new WindowAdapter()  {public void windowClosing(WindowEvent e)   {System.exit(0);   }  });  setLayout(new GridLayout(2,1));  p1=new JPanel();p2=new JPanel();t1=new TextField();t2=new TextField();  l1=new Label();l2=new Label();b1=new JButton("复制");b2=new JButton("复制");  p1.setLayout(new BorderLayout());  p2.setLayout(new GridLayout(3,1));  p1.add("North",t1);p1.add("East",b1);p1.add("Center",l1);  p2.add(t2);p2.add(l2);p2.add(b2);  b1.addActionListener(this);b2.addActionListener(this);  add(p1);add(p2);setVisible(true);setSize(500,400); } public void actionPerformed(ActionEvent e)......

阅读全文(6794) | 评论:0

单选按钮(2007-12-20 08:38:00)

摘要:最基本的单选按钮使用,见笑了。 import java.awt.*;import java.awt.event.*;import javax.swing.*;public class Check extends JFrame implements ActionListener{JRadioButton c1,c2;ButtonGroup b; public static void main(String args[]) {new Check(); } public Check() {super("单选按钮");  addWindowListener(new WindowAdapter()  {public void windowClosing(WindowEvent e)   {System.exit(0);   }  });  b=new ButtonGroup();  c1=new JRadioButton("启用",true);  c2=new JRadioButton("禁用",false);  b.add(c1);b.add(c2);  c1.setEnabled(false);  setLayout(null);add(c1);add(c2);  c1.setBounds(60,140,60,20);c2.setBounds(180,140,60,20);  c1.addActionListener(this);  c2.addActionListener(this);  setVisible(true);  setSize(300,240); } public void actionPerformed(ActionEvent e) {if(e.getSource()==c2)  {setTitle("启用第二个单选按钮");   c1.setEnabled(true);c2.setEnabled(false);  }  else  {s......

阅读全文(6820) | 评论:0

扫描线种子填充算法(2007-12-20 08:01:00)

摘要:这就是扫描线种子填充程序的C实现,运行后将出现一个多边形和一个种子,由于仅是模拟,所以初始化时固定了多边形的位置和种子的位置,可以在代码中修改其位置后重新编译运行,运行时请在main()函数里设置好图形驱动程序路径,因人而异了。 #include<graphics.h>#include<stdio.h>#include<malloc.h>#define bordercolor 15#define backcolor 0#define seedcolor 4#define fillcolor 10 typedef struct Point{int x; int y;}point; typedef struct Stack{point *base; point *top;}*stack; void initstack(stack s){(*s).base=(point*)malloc(sizeof(point)); if(!(*s).base)exit(1); (*s).top=(*s).base;} void push(stack s,point p){*((*s).top)=p; (*s).top++;} int stackempty(stack s){if((*s).top==(*s).base)return(1); else return(0);} point pop(stack s){(*s).top--; return(*((*s).top));} void drawgraphics(){rectangle(100,100,539,299); rectangle(150,150,489,249);} point produceseed(){point p; p.x=125; p.y=200; return(p);} void intostack(stack s,int y0,int xl,int xr){int x,y; point tm; for(x=xl,y=y0;x<=xr&&x<getmaxx();x++) {if((x!=xr&......

阅读全文(13409) | 评论:1

JApplet上画圆(2007-12-16 21:49:00)

摘要:一个小程序,自己写一个网页文件嵌入运行就行了,不过没什么技术含量,仅作为一个学习过程加以收藏。 import java.awt.*;import java.awt.event.*;import javax.swing.*; public class RandomClick extends JApplet{Color c;int x,y; public void init() {addMouseListener(new MouseAdapter()  {public void mousePressed(MouseEvent e)   {x=e.getX();y=e.getY();    repaint();   }  }); } public void paint(Graphics g) {c=new Color((int)(Math.random()*256),(int)(Math.random()*256),(int)(Math.random()*256));    g.setColor(c);    g.fillOval(x-10,y-10,20,20); }}......

阅读全文(7461) | 评论:0