Problem/Motivation

There's no Russian administrative territory divisions in module now.

Proposed resolution

Add administrative areas from https://www.iso.org/obp/ui/#iso:code:3166:RU

Remaining tasks

Review the patch
Provide a way to properly display "federal cities" (Moscow,...) without duplication of area and city name
Commit!
Have fun!

User interface changes

API changes

no

Original report by @Daniel A. Beilinson

Comments

adubovskoy’s picture

+1. Or commit this patch or remove "states" for Russian language. Current empty textfield is confusing customers.

podarok’s picture

Version: 7.x-1.0-beta3 » 7.x-1.x-dev
Status: Active » Needs work

First of all - You should reroll Your patch against latest dev version

+++ b/sites/all/modules/addressfield/plugins/format/address.incundefined
@@ -337,6 +337,95 @@ function addressfield_format_address_generate(&$format, $address, $context = arr
   }
+  ¶
+  else if ($address['country'] == 'RU') {

trailing whitespace

andypost’s picture

This also debatable - should be use t("English name of Russian state") for at all!

adubovskoy’s picture

My opinion: we should. I will translate it to official Eng. variant, "Республика Карелия" -> "Republic of Karelia" (http://gov.karelia.ru/gov/index_e.html), etc. Working on a patch. )

adubovskoy’s picture

Status: Needs work » Needs review
StatusFileSize
new4.06 KB

Here is patch. For regions I use official translation of the Constitutuon RF. For keys I decided not to use abbreviations, but codes of Russian regions.

adubovskoy’s picture

StatusFileSize
new4.06 KB

Hm, sorry. Last patch have mistakes. Here is the correct version.

neochief’s picture

Status: Needs review » Needs work

Looks like there's still extra space before "else" statement.

podarok’s picture

#6 looks good for me with #7

andypost’s picture

+++ b/plugins/format/address.incundefined
@@ -337,6 +337,94 @@
+      '04'   => t('Altai Territory '),
...
+      '51'   => t('Murmansk Region '),
+      '83'   => t('Nenets Autonomous Area '),

Extra space in area-name and indent for else

+++ b/plugins/format/address.incundefined
@@ -337,6 +337,94 @@
     );
   }
+    else if ($address['country'] == 'RU') {
+    $format['locality_block']['administrative_area']['#options'] = array(

Wrong indent

ardas’s picture

Great! Thanks for this work. States look good to me as well.
+100 for including this into the module...

The only question is should this be in address.inc file or should we create it as a plugin (if this is possible in address field) so that this code is only loaded when it is really needed?

adubovskoy’s picture

Status: Needs work » Needs review
StatusFileSize
new3.97 KB

Remove extra spaces, #7

podarok’s picture

Status: Needs review » Reviewed & tested by the community

status

adubovskoy’s picture

StatusFileSize
new3.97 KB

Ohh, I find one more extra space, fixing.

andypost’s picture

Status: Reviewed & tested by the community » Needs work

#10 exposes a good idea, so we could allow this list to be maintainable and plugable

+++ b/plugins/format/address.incundefined
@@ -337,6 +337,94 @@ function addressfield_format_address_generate(&$format, $address, $context = arr
+      '51' => t('Murmansk Region '),
+      '83' => t('Nenets Autonomous Area '),

Still have extra space

adubovskoy’s picture

StatusFileSize
new3.97 KB

Sorry. Fixed.

andypost’s picture

Status: Needs work » Reviewed & tested by the community

Great! Actually we need a follow-up to revamp a form for russian addresses and probably a different formatting. This change should have a big impact on adoption Drupal Commerce for russian market

podarok’s picture

srgk’s picture

hey! can anyone tell me how to sort the translated russian regions?
except manually in the patched file, where they are sorted alphabetically in English

thanks

друзья, подскажите как сортировать по алфавиту переведенный список регионов россии, спасибо!

andypost’s picture

For that purpose we need a special kind #1171454: Address formats for Estonia, Latvia, Lithuania

j0rd’s picture

Issue tags: +pluggable regions

This is a duplicate of
#1829900: [meta] Address Field 2.x needs pluggable administrative areas and an actual API

If you think so to, please close your ticket.

j0rd’s picture

This is a duplicate of
#1829900: [meta] Address Field 2.x needs pluggable administrative areas and an actual API

If you think so to, please close your ticket.

rszrama’s picture

Title: Russian states » Add administrative area #options for Russian regions
Component: Code » Address formats
Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Agreed w/ j0rd in that we won't solve the meta-issue here, but in the interest of moving things forward, I'm happy to commit Russian regions to the address.inc until we move to a more robust solution. However, looking at the patch that has the greatest support (#15), I don't get why you've decided to use these numbers. I see they're used on license plates (http://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Russia#Regio...), but they aren't the ISO abbreviations (http://en.wikipedia.org/wiki/ISO_3166-2:RU). Why did you decide to use the numbers instead of the ISO abbreviations, and I suppose are region abbreviations ever used in address displays in Russia?

andypost’s picture

Status: Postponed (maintainer needs more info) » Needs work

Ryan, ISO-abbr is never used in russian public address systems. Anyway iso-letters makes more sense as keys, because numbers are always changing (cities are growing). Also we are working on "kladr (fias)" module that could be used as vocabulary to fill areas and other subdivisions of addressfield.

adubovskoy’s picture

StatusFileSize
new4.59 KB

I agree, ISO will be better. Here is patch with new keys and region names from ISO.

rszrama’s picture

Category: task » feature

As far as I know, the strings should still be in English in t() and then translated via the localization system. Your last patch in #15 still had them in English.

serega386’s picture

else if () {}

asort($format['locality_block']['administrative_area']['#options'],SORT_LOCALE_STRING);

serega386’s picture

Issue summary: View changes

Updated issue summary.

vvs’s picture

Issue summary: View changes
StatusFileSize
new10.05 KB

Thanks for the patch. I'm added translation for it.

ulia’s picture

hi! 403 for download addressfield.ru_.po. could you help with this?

vvs’s picture

StatusFileSize
new10.05 KB

Renamed it to .txt

sin’s picture

Thanks! What work need to be done here?

sin’s picture

Assigned: Unassigned » sin
Status: Needs work » Needs review
StatusFileSize
new4.75 KB

Here is the patch at #24 rerolled against latest dev.
We added a render option value.
We also reordered address components as we used to in Russia.

The patch is prepared by Tempus Icarus International Summer School 2014 "IT in Engineering" students, Rostov-on-Don. Please test and commit :)

bojanz’s picture

Hi everyone, sorry for the long wait in getting this committed.

I'm fine with committing the administrative areas in #31.

Comparing the ISO list (copied into the patch) with the UPU list, I see that the UPU list has shorter names, for example "Kabardino-Balkaria" instead of "Kabardino-Balkarskaya Respublika".
Is the current, long form the way russian speakers would expect to see it, or is it better to pursue the shorter form?

andypost’s picture

This list outdated a bit (no idea the state of Crimea) also Moscow used twice but we have moscow city and moscow oblast.
+1 to use respulika, kray as we write it as address

bojanz’s picture

Status: Needs review » Needs work

Thanks for the feedback, andypost.
I'll look into making the changes for Moscow (and Crimea if it got through ISO yet, but I doubt it).

andypost’s picture

Issue tags: +Needs reroll

According to http://en.wikipedia.org/wiki/ISO_3166-2:RU
we need to use full names

PS: patch does not apply

adubovskoy’s picture

I think we need to follow ISO, https://www.iso.org/obp/ui/#iso:code:3166:RU. Short-list from russian post http://www.upu.int/fileadmin/documentsFiles/activities/addressingUnit/ru... can add some confusion, as example: Novgorod as province, but if I want send letter to someone from Borovishi (https://en.wikipedia.org/wiki/Borovichi), I need to write "Novgorodskaja oblast", as in ISO.

About Krimea: we haven't it in ISO now, we can just wait, let's not include it in patch.

I think patch from #34 is ready. Andypost, what do you think?

andypost’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new4.57 KB

So here's reroll, let's get some more reviews for a week.
Suppose more Russians should chime in and test UI at
http://simplytest.me/project/addressfield/7.x-1.x?patch[]=https://www.dr...

andypost’s picture

Issue summary: View changes
StatusFileSize
new55.56 KB

Currently it looks like

pvasili’s picture

Нужно не изобретать, а смотреть стандарты (например ФИАС) если для почты то, скорее почтовые правила.

Поскольку у нас 1 поле State, то край и регион тут лишние. В поле должна остаться только область.
Иначе вы не сможете отправить письмо в Хабаровский край и конкретный город без указания области (в разных областях названия городов зачастую повторяются). Ну и сами территориальные деления (кроме областей) иногда изменяются :).
В поле город (для районов и посёлков), областной город (без указания State для) для областных городов и 3 города фед.значения: Москва, Санкт-петербург, Севастополь.

pvasili’s picture

Issue summary: View changes

Function t() is absolutely unnecessary.
(как приятно будет идивлен почтальон в РФ, если увидет адрес вместо транслитерации на латинице на ифрите или хинди :) )

adubovskoy’s picture

Assigned: sin » Unassigned
Category: Feature request » Task
Status: Needs review » Needs work
Issue tags: -pluggable regions

Ouch. I have some questions for us:

  1. What better for foreign customers? I mean, if you don't know russian, how do you get real post adress? Googling it, asking friends? Which name will you get? "Altay, Respublika" or "Republic of Altai"? Google/Yandex can translate both and do it correct. English speakers, I think we need your help)
  2. What we'll do with "cities as federation subject"? City in UI - next field. State:Moskva,City:Moscow incorrect, isn't it? Maybe remove it from States?

for pvasili: we need t('') function, it's absolutely necessary for multilingual sites and font families without cyrillic.

bojanz’s picture

Status: Needs work » Needs review

#37 looks good to me.

I like "Altay, Respublika" because it gives me the most relevant part first.
Showing me "Republic of" first just adds visual noise and breaks proper sorting.

As for "city as federation subject", in that case it needs to be in both the administrative area (the province dropdown) and the locality.
I've geocoded a random Moscow address, and google agrees: https://maps.googleapis.com/maps/api/geocode/json?address=Pravda%20stree...

ofry’s picture

bojanz, it isn't Moscow :) It's Minsk, capital of Belarus' :)

ofry’s picture

bojanz’s picture

@ofry
Doesn't say Minsk anywhere. In any case, your link has the same example, Moscow as both the city and the province.

andypost’s picture

Issue summary: View changes

@bojanz #42 points for me to Беларусь (BY) probably their geocoding affected by source IP somehow.

            {
               "long_name" : "Минская область",
               "short_name" : "Минская область",
               "types" : [ "administrative_area_level_1", "political" ]
            },
            {
               "long_name" : "Беларусь",
               "short_name" : "BY",
               "types" : [ "country", "political" ]
            }

PS: summary updated

bojanz’s picture

StatusFileSize
new33.65 KB

I just closed #1152700: Support Russian adresses, the latest commits fixed the field ordering for Russia, it now matches what is defined in Google's dataset for Android.
No weight changes need to be done in this patch. See screenshot.

andypost’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new4.43 KB
new12.92 KB

Rerolled and cleaned up.

PS: we need coreissue to update "Russia" to "Russian Federation" ;)

bojanz’s picture

Title: Add administrative area #options for Russian regions » Add administrative areas for Russian regions
Status: Reviewed & tested by the community » Fixed

Committed, thank you!

  • bojanz committed 61d681c on 7.x-1.x authored by andypost
    Issue #1665788 by adubovskoy, andypost, VVS, bojanz, sin, Daniel A....
andypost’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.