-
-
Notifications
You must be signed in to change notification settings - Fork 158
Taxonomy model for Label is not correct #720
Taxonomy model for Label is not correct #720
Conversation
e896c8e
to
210e186
Compare
By adding As you can see below in the before and after pictures, the Labels are now included in the tableview of the ProductDetail Rows but they are not being translated into English, which is the default language on my testing device. The labels 'Bio, Bio européen, Agriculture UE/Non-UE' are the French translations of those Labels, and in English they should say 'en:organic, en:eu-organic, en:ab-agriculture-biologique, en:eu-non-eu-agriculture.'
|
Well, it looks good. Is now the translation the only remaining issue? |
@aleene |
d3f737e
to
ea88f67
Compare
@teolemon @aleene
Language : French
Language : French Language : English [EDIT: Below are my findings from before I figured out how to use taxonomies to translate Labels and Categories] The product I tested with was Orange Amère - Barcode: 3760036843626(EAN / EAN-13) On the dev server, this product’s On the production server, this product’s |
Let's focus on what production does. label_tags are always in English, and labels will be in the main language of the product. 80-90% of the values will be in label_tags in english, and the non-taxonomized values will also be there, with a language prefix. |
@teolemon If you look at my 2nd and 3rd screenshots in my last post you will see that the Labels are displaying their translated values, and if you look at the changes I made to |
Sources/ViewControllers/Products/Detail/ProductDetailViewController.swift
Outdated
Show resolved
Hide resolved
Sources/ViewControllers/Products/Detail/ProductDetailViewController.swift
Outdated
Show resolved
Hide resolved
ea88f67
to
0578263
Compare
Labels were partially implemented but still needed to be incorporated into the API Models and Network Services. In doing so, it was discovered that the Taxonomies weren't being downloaded to Realm on first launch of the app as intended. After fixing that and adding the Label taxonomy to Models, they were successfully retrieved and stored. Then, to allow Labels to be displayed by ProductDetailViewController, they were included in the OFFJson mapping. The downloaded taxonomies were then used to translate Labels and code was added to fix translation of Categories. Lastly, the functionality to link link Labels to their OFF urls was added. Closes openfoodfacts#719
0578263
to
34bccfe
Compare
Sources/ViewControllers/Products/Detail/ProductDetailViewController.swift
Outdated
Show resolved
Hide resolved
static func url(forLabel label: Label) -> URL { | ||
return URL(string: "\(baseUrl())/label/\(label.code)")! | ||
} | ||
|
||
// Not sure if there is a taxonomy for this | ||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged with the latest changes from this PR Open weblinks to OFF urls in the language chosen in app settings, dynamically #747
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many changes, so if it works for you, we can do some testing on develop.
PR Description
While discussing how to create a mock-up for Issue #707 @teolemon realized that Labels have not been implemented yet. I have taken the first steps in adding the necessary methods to TaxonomyService, TaxonomyParser PersistanceManager by mimicking the other Taxonomy methods in the protocol/API.
I am stuck on how to implement the Label model. I copied the Category model because from my limited knowledge, they seem to have similar data models, and I noticed that the model for Mineral may be identical to Category. For clarity, I am talking about the models under Sources/Models/API/Taxonomies/
Type of Changes
Checklist
Make sure you've done all the following (Put an
x
in the boxes that apply.)