Multi Languages Support

Table of Contents

Introduction

I am thrilled that PPResume (opens in a new tab) has taken a big step forward to support multi languages, starting with Chinese, with 3 variants, Simplified Chinese (opens in a new tab), Traditional Chinese Hong Kong (opens in a new tab) and Traditional Chinese Taiwan (opens in a new tab).

PPResume was designed from the ground up to support internationalization and localization (opens in a new tab), and I finally got some time to implement this recently. As far as I know, PPResume should be the only resume builder on the market that supports multi languages while following best typesetting practices.

From now on, you can specify a language when creating new resumes:

New Resume With Language

You can also switch language for existing resumes:

Switch Resume Language

When switching languages, all idioms and conventions of the target language are strictly observed.

Here are some sample resumes.

English Resume

Simplified Chinse Resume

Traditional Chinse HK Resume

Traditional Chinse TW Resume

If you look closely, you will notice that although there are many similarities between English resumes and Chinese resumes, there are still two major differences in terms of typesetting:

  1. there is no italics in Chinese resumes so all dates are not italicized as in English resume, as it is considered bad practice (opens in a new tab) to use italics in Chinese typesetting
  2. numbers (opens in a new tab) in English resumes are old style, while Chinese resumes use lining style

All I can tell you here is that supporting multi languages is not as simple as translating a list of words from one language to another language, as aforementioned, you have to follow target languages' conventions and idioms. Typesetting practices with mixed languages is another big topic as well. If you are not a tech guy, you can close this tab and take a break. However, if you do want know the nuts and guts, you can stay and continue reading this post.

Engineering

OK, you are not closing this tab, let us dive a little more into the tech details here.

Technically, there are two categories of things to do when supporting multi languages:

In practice, i18n always comes first, l10n comes after. For multi languages support in PPResume, we have made the following efforts to get the best l10n for resumes in addition to the pure i18n translation.

Date

Resumes often use a lot of dates for work experience and education background items. Dates are presented differently in English and Chinese, e.g. "Jun 2018 – Present" in English should be translated as "2018 年 6 月至今" in Chinese,the position of the year and month should be reversed, and the en-dash "–" should be replaced by "至".

With JavaScript, you can use Date.prototype.toLocaleDateString() (opens in a new tab) to get localized string output for a Date object.

Old Style Numbers

Old style numbers, also known as text figures (opens in a new tab), designed with varying heights in a fashion that resembles a typical line of running text, hence the name.

Text Figures

In contrast, lining style numbers (also called lining, titling or modern figures), have the same height as upper-case characters.

PPResume defaults to old style numbers for English resumes and lining style numbers for Chinese resumes. Why? Because Chinese characters all have the same height and width (that is why Chinese characters are also called "方块字", which means square characters), basically all Chinese characters are titled by nature. By adopting numbers in the lining style, the number style is adapted more closely to the Chinese characters.

High-quality typesetting generally prefers text figures in body text: they integrate better with lowercase letters and small capitals, unlike runs of lining figures. Lining figures are called for in all-capitals settings (hence the alternative name titling figures), and may work better in tables and spreadsheets.

Text figures (opens in a new tab)

Traditional Chinese Variants

Traditional Chinese has at least two variants, namely, the Hong Kong variant zh-HK (opens in a new tab) and the Taiwan variant zh-TW (opens in a new tab). Most of the scripts in zh-HK and zh-TW are identical, with only a few minor differences.

For example, the word "software", when translated to zh-HK, it is "軟件", while in zh-TW, it is "軟體". There are at least tens of words in English that are translated differently in zh-HK and zh-TW, check here (opens in a new tab).

OpenCC (opens in a new tab) is an open source project that can perform convensions between Simplified and Traditional Chinese, with support for both zh-HK and zh-TW.

In general, PPResume can't do too much for the difference between zh-HK and zh-TW , as users have to decide which variant to use when writing resumes and make sure that the content conforms to the idioms and convensions of zh-HK or zh-TW. However, there is one thing that PPResume needs to handle properly for zh-HK and zh-TW, as some countries have different names in zh-HK and zh-TW. Saudi Arabia (opens in a new tab), for example, is translated as "沙特阿拉伯" in zh-HK and "沙烏地阿拉伯" in zh-TW. There are also a few other countries. PPResume takes care of all countries that has different translations in zh-HK and zh-TW.

Location

The address formats differ between English and Chinese conventions. In English, the smaller segment, such as the address line, town and county comes first, follows by city, state and country, while in Chinese the order is totally reversed.

Don't worry, PPResume has already handled this for you.

Punctuations

Comma

English uses the comma , as a separator to separate parts of a sentence and items in a list, while Chinese uses a Chinese comma to separate sensences, and a dedicated enumeration comma (顿号 (opens in a new tab), ) to separate items in a list (e.g. keyword list).

With PPResume's TagsInput (opens in a new tab) component for the input of keywords and courses, the correct seperator punctuations are used according to the main language of the resume.

Colon

English and Chinese also have different (opens in a new tab) colons. The English colon (opens in a new tab) is :, with Unicode U+003A, while the Chinese colon (opens in a new tab) is , with Unicode U+FF1A.

As you can always trust, PPResume also takes care of this. You may wonder, how does PPResume deal with this?

Under the hood, PPResume uses moderncv (opens in a new tab) as the current default template. Since moderncv defines a macro \cvitemwithcomment (opens in a new tab), we need to override this colon in line 188 (opens in a new tab) based on the main language of the resume. Hence the code:

<= #layout.computed.environment.isCJK =>
% renew moderncv command to adapt for CJK colon
\renewcommand*{\cvitem}[3][.25em]{%
  \ifstrempty{#2}{}{\hintstyle{#2}<= &templateTranslations.punctuations.Colon =>}{#3}%
  \par\addvspace{#1}}
 
\renewcommand*{\cvitemwithcomment}[4][.25em]{%
  \savebox{\cvitemwithcommentmainbox}{\ifstrempty{#2}{}{\hintstyle{#2}<= &templateTranslations.punctuations.Colon =>}#3}%
  \setlength{\cvitemwithcommentmainlength}{\widthof{\usebox{\cvitemwithcommentmainbox}}}%
  \setlength{\cvitemwithcommentcommentlength}{\maincolumnwidth-\separatorcolumnwidth-\cvitemwithcommentmainlength}%
  \begin{minipage}[t]{\cvitemwithcommentmainlength}\usebox{\cvitemwithcommentmainbox}\end{minipage}%
  \hfill% fill of \separatorcolumnwidth
  \begin{minipage}[t]{\cvitemwithcommentcommentlength}\raggedleft\small\itshape#4\end{minipage}%
  \par\addvspace{#1}}
<= /layout.computed.environment.isCJK =>

Here templateTranslations.punctuations.Colon is a dynamic variable that would be assigned to the correct colon based on the main language of the resume.

CJK Font

Last but not least, the size of the CJK character set is huge and many fonts are missing glyphs for some CJK characters, resulting in an empty sqaure placeholder in the final PDF output, which is ugly and strange.

Under the hood, we use CTeX (opens in a new tab) for CJK typesetting. By default, CTeX offers the six fontset choices to choose from:

adobe, mac and windows fonts are not available for commercial use; a few founder fonts are free for commercial use, but must be downloaded and installed manually; fandol fonts is available in the standard texlive distribution, however, some commonly used Chinese characters such as , are missing (opens in a new tab). ubuntu font seems to be our last choice, however, by default, ubuntu font use gkai00mp.ttf: AR PL KaitiM GB,文鼎PL简中楷:style=Regular for Kai form (opens in a new tab), some commonly used Traditional Chinese characters such as , are not available (opens in a new tab).

So what can we do then? Fortunately, there are some good, high quality CJK fonts available free for commercial use which also has a good coverage of the character set for both Simplified and Traditional Chinese. Thanks to Google and Adobe, Noto Fonts (opens in a new tab) are licensed under the Open Font License. You can use them in all your products and projects — print or digital, commercial or otherwise.

To use the Noto fonts in LaTeX, you must first install them:

# if you are on macOS
brew install font-noto-sans-cjk font-noto-serif-cjk
 
# if you are on Ubuntu
apt install -y fonts-noto-cjk fonts-noto-cjk-extra

Then set Noto Fonts as the main CJK font for xeCJK in the LaTeX preamble:

% ctex settings
% ref: http://ctan.mirrorcatalogs.com/language/chinese/ctex/ctex.pdf
\usepackage[UTF8, fontset=none]{ctex}
 
\setCJKmainfont{Noto Serif CJK SC}
\setCJKsansfont{Noto Sans CJK SC}
\setCJKfamilyfont{zhsong}{Noto Serif CJK SC}
\setCJKfamilyfont{zhhei}{Noto Sans CJK SC}

You are all set then. Feel free to enter any CJK characters in your LaTeX documents and compile them with XeTeX (opens in a new tab), you should be good to go.

Look ahead

OK, long enough boring tech details, time to close this tab :-). But before you close this tab, I want to tell you that, the groundwork has been done and it won't be too hard for PPResume to support more languages, Japanese, French, Spanish, etc. Stay tuned!

You can close this tab now.