Hello.

I have a DB, in it regions and cities of the USA. But the trouble is that they are in Russian.

Task: take names from the database one by one, for example, “Washington”, and rewrite as “Washington”.

Decision 1 - take everything with pens, and make (long and tedious, there are millions of them)
Solution 2 - write some script that will do it.

I would be grateful for any clue, just do not mock my grief.

    2 answers 2

    • If the regions are not replenished in any way and are used only for communications, then you need to translate them once, then it is more profitable to make everything handles through any translator.

    • In the opposite case, this means that the database is replenished, then, before recording, it is better to make a request to the translator's API and only then save it, and I can offer the following structure:

    regions:

    +-------+-------+ | id | ... | +-------+-------+ | 1 | ... | +-------+-------+ | 2 | ... | +-------+-------+ 

    region_translations:

     +-------+-----------+------+-------------+ | id | region_id | lang | name | +-------+-----------+------+-------------+ | 1 | 1 | ru | Вашингтон | +-------+-----------+------+-------------+ | 2 | 1 | en | Washington | +-------+-----------+------+-------------+ | 3 | 2 | ru | ... | +-------+-----------+------+-------------+ | 4 | 2 | en | ... | +-------+-----------+------+-------------+ 
    • No, not replenished, but there are miles! Unloaded the base into the text, put it in google.translate, translates the devil-like. Although one at a time if inserted, it translates normally. And when all the cities are in a crowd, he considers them as a single text, and tries to make it literally. - Alexander Vladimirovich
    • Try to select them in csv or another format, so that they are with a newline character and then insert it immediately in a column. - Andrei Talanin
    • Thank you, unloaded into .xsl, translated, everything is fine)) Now it remains to load it all back, but I think I can handle it - Alexander Vladimirovich
    • Upload table to text file
    • Use some online transliterator
    • Upload back
    • Transliteration is not quite that, I think, for example, your proposed transliterator translated Iowa as Ajova. But perhaps Google translate will do better. I'll go try. Thank! - Alexander Vladimirovich
    • I brought the first one. And yes, you need to choose. - Majestio