Drupal: Managing translations in a multisite environment.

Currently, I have been working on a complex Drupal project with around 400 subdomains and half a million nodes. All the subdomains have same codebase. The product is in Chinese language and my real issue was to translate the strings from English to Chinese but the problem was that if a string is translated in one subdomain, it has to be translated to other 399 subdomains as well, so I decided to use the translation table of one (parent) domain on all other subdomains. So I just added the following lines to the settings.php of all 400 domains:

$databases['default']['default']['prefix'] = array(
'default' => 'mysite_',
'locales_target' => 'parent_db.mysite_',
'locales_source' => 'parent_db.mysite_',
);

“parent_db” is the database of the parent subdomain. Now if you change the translation of any subdomain, it will use the table of “parent_db” and will be changed in all 400 subdomains.

Working in China

My working span in China was short. I was hired by a startup named biyixia.com as lead software engineer. I was already working with them offshore but due to long documentation process, I had to wait too long to apply for the visa. Chinese work visa process needs at least two years of work experience and I was 4 years experienced by that time so it was not a big deal.

First couple of weeks are always the toughest ones in any new culture so mine were no different. It’s really hard to adapt the life style especially food. I was used to Pakistani style food but my team only consists of chinese guys so expecting them to prepare Pakistani food for me was a big no no. I was living in Changping district in Beijing and there is hardly any Pakistani restaurant but I discovered some Muslim(Xinqiang) restaurants in the neighborhood where I usually used to eat. Otherwise I mostly rely on vegetables.

The team was so cooperative, I am always very thankful to them. They never made me realize that I am away from my family. Every evening I used to go to the Beijing Electrical Engineering University nearby for a walk. It was awesome.

Beijing is mostly hated by expats due to its bad air. The air pollution is a big issue in almost every city in China. I am from Lahore and it’s pretty much polluted but believe me Beijing is tougher than that. I always user to check pm2.5 before I go out.

Hovering around in Beijing can be complex for new comers but it has excellent public transportation especially the subway. It works just like any other subway in the world. You can travel between any two terminals for just 2 RMB. On the weekends, we used to go to the Olympic park for jogging and after that we used to go to Chaoyang to enjoy Pakistani food at Khanbaba.

It is always recommended that you should live close to your workplace if you are an expat as Subway is so crowdy in the mornings.

Chinese society is a capitalist society and you will feel that. Most of the people just have one objective, earn as much money as they can. Beijing has a lot of people coming from different regions of China so living cost is very high i.e. 3000RMB per month for a one room apartment in Changping. So most of the young guys share apartment with others to reduce the living cost.

Overall I feel very lucky that I got the chance to live in Beijing and worked with wonderful people. China, I miss you.

Protectorate stamp for emigrants other than Middle East

Congratulations if you are a Pakistani and got the job in a foreign country. But there one hiccup, protactorate stamp[1], yes sir. You need to get a protactorate stamp if you have got an employment visa and going overseas for work. There are few questions people usually search for when they get an employment visa and want to get protactorate stamp:

How to get a protactorate stamp?

You can check the detailed method of getting your passport stamped here.

My employment visa is pasted on my passport, do I need a protactorate stamp?

Yes. The protactorate stamp is required for any type of employment visa whether it is pasted on your passport or is a paper visa.

What will happen if you go to airport without a protacorate stamp?

Pakistan immigration will not let you board the plane.

I am going to China on Employment visa, do I need a protactorate stamp?

Yes. I went to China for a job in year 2014 and I had to get the protectorate stamp.

I have got the Employment visa and passport stamp, can I travel with a one way ticket?

Yes, no one will stop you as of current rules 🙂

Please note that I am not at all an overseas employment consultant, I am just sharing my own experiences here so that my fellow Pakistanis can get benefitted and save their time.

Regarding any other questions, please feel free to write in comments.

[1]http://en.wikipedia.org/wiki/Bureau_of_Emigration_and_Overseas_Employment#Passport_stamping