Closed (fixed)
Project:
Paddle
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
4 Apr 2013 at 11:20 UTC
Updated:
19 Apr 2013 at 10:40 UTC
Jump to comment: Most recent file
Create two taxonomy vocabularies:
* tags
* general
Create them in a function in a separate file which is to be included in the paddle profile's hook_install().
Create a variable for the tags vocabulary to indicate that this is a "flat" vocabulary: taxonomy_vocabulary_tags_type = flat
better ideas than "type" are welcome
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | taxonomy-multilingual.png | 70.81 KB | cyberwolf |
Comments
Comment #1
angel.hComment #2
cyberwolf commentedComment #3
cyberwolf commentedIf $voc is not an object, $voc->vid will be never set, so that condition can be left out.
taxonomy_vocabulary_save() will normally add the vid property to the object passed to it, it uses drupal_write_record() internally, so we can retrieve the vid from that property instead of doing an additional database query.
I'd replace this with a loop over the different properties to translate (name/title, description), then a loop over the languages inside that property, then insert the translation.
Language 'en' needs to be skipped here by the way, as that is our source language.
Can you replace the Dutch translation by "Trefwoorden (tags)"?
Can you replace the Dutch translation by "Algemene woordenlijst" and the English source by "General vocabulary"?
Comment #4
cyberwolf commentedComment #5
cyberwolf commentedUpon installation I get a PHP fatal error:
Call to undefined function taxonomy_vocabulary_machine_name_load()
I assume because the taxonomy module is not listed as a dependency of the paddle profile and thus will not be enabled before our hook_install() implementation is called.
Comment #6
angel.hShould be better now.
Comment #7
cyberwolf commentedOne more thing: the multilingual mode of the vocabularies should be set as showed on the screenshot, so a language can be set on terms that are added to the vocabularies later on.
Comment #8
cyberwolf commentedAnd with additions of #6 also a coding standard violation:
Comment #9
angel.hStrange, I added taxonomy in .info. I guess I didn't commit it.
Comment #10
cyberwolf commentedOk. Tell me when it's ready for review again.
Comment #11
cyberwolf commentedI'll quickly fix the remaining issues so we can merge this.
Comment #12
cyberwolf commentedMerged.