Translating Custom Fields, without JoomFish or Falang

  • Posts: 136
  • Thank you received: 7
8 years 4 weeks ago #253362

-- HikaShop version -- : 2.6.4
-- HikaMarket version -- : 1.7.2
-- Joomla version -- : 3.6.3
-- PHP version -- : 7.0
-- Browser(s) name and version -- : All

Hi

I can see in Forum, that you can translate Custom Fields with JoomFish or Falang. I would really like to avoid installing any of these for handling Multilanguage in my Joomla. Since J3.5 in my opinion you can achieve a Multilanguage site without these components by just using simple language override and translation of components, modules, plugins.

Is it possible or could it be a feature request, that when adding a Custom Fields with "Column name" e.g. 'vendor_mycustom_field', HikaShop would then look for a language string in /language/overrides/ VENDOR_MYCUSTOM_FIELD=
I think this approach would be nice and easy, if you add a Custom Field, then remember to add the Column name to language override. If Column name exist, then use string in language file, otherwise use Label from Custom Fields.

Regards,
Henrik


.ninja { color: black; visibility: hidden; }
In case of fire:
1. git commit
2. git push
3. exit building

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 4 weeks ago #253368

Hi,

That's already the case.
You can see that with the address custom fields that are installed by default with HikaShop. The translation of the label is automatically loaded from the language translation file of HikaShop so that the registration form is available in all the languages by default, without haivng you to translate them with a third party extension.

Please Log in or Create an account to join the conversation.

  • Posts: 136
  • Thank you received: 7
8 years 2 weeks ago #254468

I still don't quit understand this.
I will prefere to keep my Custom Fields in English. But what language string do I add to /language/overrides/da-DK.override.ini for my 'pre_order' field?

PRODUCT_PRE_ORDER="Forudbestilling"

Or?

It looks to me as it just show the Label and therefore: Pre-order


.ninja { color: black; visibility: hidden; }
In case of fire:
1. git commit
2. git push
3. exit building
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 2 weeks ago #254498

Hi,

If the title of your field is pre-order, then the translation key should be written:
PRE-ORDER="Forudbestilling"
However, the - is not a validate character for translation keys.
So for it to work properly you need to remove the - in the title and have for example "preorder" with the translation key:
PREORDER="Forudbestilling"

Please Log in or Create an account to join the conversation.

  • Posts: 136
  • Thank you received: 7
8 years 2 weeks ago #254562

Hi

It's working! Just don't use - or .
Just write plane text in English and if you write "Pre Order" in Label, then it's PRE_ORDER="Pre-Order" in language file.
You can even use JYES and JNO if you have a checkbox.

Thank you!

Regards,
Henrik


.ninja { color: black; visibility: hidden; }
In case of fire:
1. git commit
2. git push
3. exit building

Please Log in or Create an account to join the conversation.

Time to create page: 0.073 seconds
Powered by Kunena Forum