Recommend this page to a friend!

      Countries Info  >  All threads  >  Idea  >  (Un) Subscribe thread alerts  
Summary:Add another table with the translated country-names!
Author:Jon Lennryd
Date:2017-06-16 20:04:31

  1. Idea   Reply   Report abuse  
Picture of Jon Lennryd Jon Lennryd - 2017-06-16 20:04:31
Hi, I have made a somewhat similar thing once, so I have an idea for you.
To make it simple to add more translations for the country-names, add another table, like this pseudo-code:

create table translated_country_names (
`country_code` varchar(2) CHARACTER SET ascii NOT NULL DEFAULT '',
`lang_code` varchar(8) CHARACTER SET utf8mb4 NOT NULL,
`cname` varchar(255) CHARACTER SET utf8mb4 NOT NULL,

Then insert each translated country:

insert into translated_country_names (country_code, lang_code, cname) values('ad','de','Andorra');

This way you can remove all languages from your table 'countries', and later easily add more languages into 'translated_country_names'.

Nice package/table of information!

  2. Re: Idea   Reply   Report abuse  
Picture of Peter Kahl Peter Kahl - 2017-06-17 02:20:47 - In reply to message 1 from Jon Lennryd
Thanks for the feedback and idea. I'll give it a consideration.


For more information send a message to info at phpclasses dot org.