This is related to Address Field module's issue #1846850. I am running Drupal 8.5.1 with Address module version 8.x-1.3.

When creating an address field, the module assumes that if the addressee is not a person (with First, Middle and Last names), is a Company. My client is a government with departments, so this will confuse their editors. Would it be possible to change the label to "Organization" to be more inclusive? Ideally, site builders should be able to specify the label in the site building process, but that seems more involved.

Adress field

It looks as though a patch for 7.x that was started, perhaps some of it can be reused?

Thanks,

Andrea

Comments

andreathegiant created an issue. See original summary.

heyitspython’s picture

Jaesin’s picture

Is "Company" the only field that should be re-nameable?

msankhala’s picture

Issue summary: View changes
nottaken’s picture

StatusFileSize
new48.24 KB

You can use User interface translation. I use it to change the label Company to Facility Name.

Jaesin’s picture

I've also explored the translation option. It might be too much overhead in many cases. You can just add the following to settings.php.

<?php
$settings['locale_custom_strings_en']['Address label'] = [
  'Company'      => 'Organization',
];
?>

Related:
https://www.drupal.org/project/address/issues/2851549

Since there is a pretty simple workaround, I am wondering if there is any point to working on this issue. I personally think it would be better have configurable labels but the maintainers may not.

bojanz’s picture

I would not support configurable labels. Would rather document #6 in a prominent place.

That said, the underlying field is actually called "organization". It's labeled "Company" because that's what Addressfield did in D7, Google's original widget uses "Organization". So it's worth discussing whether "Organization" is actually a better/more common default.

digitalfrontiersmedia’s picture

+1 for 'Organization' over 'Company'. Company is just too restrictive.

bdanin’s picture

It would be nice to be able to re-label these fields

Instead, I just hide them and open new text fields. Why can't we re-label through the form-UI or on the field edit screen?

configurable labels seems like the way to go to me.

karimb’s picture

+1 for 'Organization' over 'Company'.
Here is the patch for the dev version.

drupalite1411’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new56.3 KB

Hi,
I have tested your above #10 patch .It is working fine. Attaching screenshot for reference.

chris matthews’s picture

Another +1 for 'Organization' over 'Company'.

dww’s picture

Title: Allow flexibility in label of "Company" field » Rename the label of AddressField::ORGANIZATION from "Company" to "Organization"

The patch and discussion has moved on from the originally proposed title. The new scope of this is simply renaming the (hard-coded) label on that field.

+1 to that. ;) It seems pretty weird to me that all the internal code refers to AddressField::ORGANIZATION but the human-readable label is "Company".

I'll give @bojanz a little while to reply if he's got any lingering concerns. If not, I'll commit this.

Thanks,
-Derek

bojanz’s picture

Let's proceed with the rename and see who complains :)

dww’s picture

Version: 8.x-1.3 » 8.x-1.x-dev
Assigned: Unassigned » bojanz
Status: Reviewed & tested by the community » Needs review

Do we care about translations for this? Does this need to happen in another branch? :( Just flag it in the release notes for 8.x-1.8?

WriteCo’s picture

How do you decide whether to use "organization" or "organisation"?

bojanz’s picture

Drupal uses US English as the default, so it's always a "z".

dww’s picture

@bojanz: So, can I go ahead and commit this to 8.x-1.x and we flag it in the 8.x-1.8 release notes as a string change for translators?

Please advise.

Thanks!
-Derek

dww’s picture

Issue tags: +String change

p.s. If we fix #2828128: Stop performing subdivision-level postal code validation as planned, that'd be another string change for 8.x-1.8...

chris matthews’s picture

caspervoogt’s picture

I initally tried using the String Overrides module for this and that didn't work. +1 for committing this. This sort of thing ought to be configurable.

bojanz’s picture

Issue tags: -Quick fix, -Novice, -String change

I no longer support committing this as-is.

I've reviewed the code that currently uses this getter. Every payment gateway we integrate with uses "company". I've also looked at a number of eCommerce solutions (Magento, WooCommerce, Shopify, Sylius etc) and they too use "company".

This tells us two things:
1) It was not unreasonable to make "Company" the default label.
2) There is an almost certain chance that if we commit this change in a stable release, a number of people will show up to complain. Possibly much larger than the number of people advocating for this change.

I think that we need official docs on how to replace the "Company" string with "Organization", and then to consider punting this to 2.x.

digitalfrontiersmedia’s picture

Companies are organizations. Not all organizations are companies, e.g. non-profits. Just sayin'.

dww’s picture

+100 to #23.

I don't personally care about payment gateways at all, but I know that puts me in the minority of Address module maintainers. ;)

Re:

I think that we need official docs on how to replace the "Company" string with "Organization", and then to consider punting this to 2.x.

I don't know how to write those docs, since I don't know how to change this without patching things. @bojanz: can you write them?

Thanks,
-Derek

bojanz’s picture

There was never a dilemma about #23. I agree with that logic too. This is about preserving backwards compatibility and expectations for current users (== almost 50 thousand sites).

The Commerce docs have an example for replacing the "Company" label with "Organization":
https://docs.drupalcommerce.org/commerce2/developer-guide/customers/addr...
I think that we need to copy all Address-specific docs from the Commerce documentation to drupal.org.

iaslam’s picture

I have a request for one of our clients to change the 'Postal code' label to 'Post code' saying Postal code is an American thing. We are based in Australia.
Since the labels are not configurable from the back-end, is there any proper way to do so through the hooks and without translations definition?
I tried the method mentioned at https://docs.drupalcommerce.org/commerce2/developer-guide/customers/addr..., however in my case, the $form_id is not same on different pages for a same form. It is like

'webform_submission_get_in_touch_node_36877_add_form' 

whereas I expect it to be

'webform_submission_get_in_touch_add_form'

(it is right on some pages though_.
So the above link does not help in my case.
Any workaround would be appreciated.

Thank you

bojanz’s picture

Version: 8.x-1.x-dev » 2.0.x-dev

We now have a 2.x branch, so we can proceed with this change there.

  • bojanz committed 7ea66837 on 2.0.x authored by KarimB
    Issue #2958971 by KarimB, heyitspython, Drupalite1411, nottaken, bojanz...
bojanz’s picture

Assigned: bojanz » Unassigned
Status: Needs review » Fixed

Committed. Now let's see how many people complain :)

Status: Fixed » Closed (fixed)

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