I'll do it, just give me CVS access and tell me how :)

Comments

rconstantine’s picture

I'll grant CVS access once you have posted the module here for review. The basic idea is to copy any one of these other contributed modules and just replace their country-specific data with your own. Be sure to note the comments I've given them so you don't make the same mistakes. And also be sue to be using the latest 'dev' version of cck_address for testing etc. It should literally take you less than half an hour to convert one of the existing modules. Also be careful of the regular expressions in the validation function. Make sure those are correct.

ximo’s picture

Assigned: Unassigned » ximo
Status: Active » Needs review
StatusFileSize
new182 bytes

I've taken the Mexican as an example, looked at your comments for the Indian and Spanish ones, and made a Norwegian one. Some things I should mention:

  • We don't have states in Norway, so I used the term County, which is the english word for what we call Fylke
  • The locale in cck_address_norway_validate_address_fields() (no_NO) is not correct as we have two languages in Norway (Bokmål and Nynorsk). The correct locale to use for Bokmål is nb_NO, while for nynorsk it's ny_NO. How can the module serve both locales? Adding nb_NO and ny_NO only generates errors.

  • I also added a space after the colons in some of the error messages so that they are all consistent, you should do this in your original code as well. Unless this will break translated string.

Other than this, it would be nice to reorder the fields, as an address is formatted differently in Norway:


We don't actually use state/provice/county at all. The recipient line may span across two lines and include co/ information or name of company. But one line is commonly used on the web. All this was taken from the Norwegian Postal Service's website.

ximo’s picture

StatusFileSize
new0 bytes

Looks like I messed up the list in the above comment :)

Here's the install file.

ximo’s picture

StatusFileSize
new0 bytes

And the module itself.

ximo’s picture

Here's how Norwegian addresses should be formatted according to the standard:

<recipient>
<street name> <house number>
<zip code> <city/place>
rconstantine’s picture

First, the Canadian module that comes with CCK_Address has an example of two languages, so check it out.

Colons - got it.

Counties as substitutes for states is totally a valid use of that field. Since you'll be translating the word 'state' into your language(s) anyway, it doesn't matter what it was originally called.

As for reordering the fields, you can't do it so far as storage is concerned, but you can change the theme functions, and the css file which should allow you to change whatever you want. There are plenty of tutorials around for changing/supplementing theme functions.

Note that until CCK fixes it, there is a problem with Views knowing about the sub fields. It only knows about the first one stored, and I think at this point it is 'street1'.

In looking at your address format post, you should be using 'street1' for both the street name and number. Recipient should not be stored generally, but could be in the 'other' field. Like I said, overriding the theme function will make it all come out just fine.

Notice that both your install and module files didn't upload properly and are listed as 0 bytes. Your info file looks fine.

Generally, for your recipient field, you may want to use the cck_fullname module. Then, someone (maybe me someday) could write an address book-style module which would associate names with addresses, emails, etc. Or, you could simply collect all of that data in a custom content type and then use Views to display it in a printable form. That wouldn't be too hard I don't think.

rconstantine’s picture

I contacted the author via the contact page of Drupal.org, so hopefully I'll hear back soon.

rconstantine’s picture

BTW, I did give you CVS access. Start by checking out the whole module (I use tortoiseCVS, so if you use that too, I can give you step-by-step instructions) to a folder called cck_address_extensions. Then make a new folder called 'norway' within that folder. Put your files into it. 'Add' the new folder and files to the project. Commit the change. If you are uncertain about any step, then don't do it. Just ask questions here.

ximo’s picture

Hi, thanks for the mail and the CVS access.

I've looked through the Canada extension as well as the India extension and made the Norway extension based on these. I'm not very accustomed to CVS (yet), but managed to add and commit the files, so they're in the repos now. I hope it's all good now - if not let, me know. Thanks!

Ps.
I noticed you have added the ability to rearrange the fields - nice :)

rconstantine’s picture

Hopefully your commit is okay. It seems one of the others with CVS access screwed it up and one of the CVS admins is trying to iron things out. There were about a dozen that were messed up, but this one seems to be the worst. If you're on windows, I recommend TortoiseCVS since it is so stinkin' easy to use. I'll check your commit once I get a chance.

ximo’s picture

I'm on OS X and would like to learn command line CVS in the first place :)

I'm pretty sure I did it right, have you gotten a chance to check it out?

Thanks.

rconstantine’s picture

This project's CVS entries are screwed up. It looks like yours got in there ok, but we're supposed to not do any more commits until things are fixed. I'll post a note here letting you guys know when that is.

rconstantine’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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