-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DRAFT: Full translation implementation #155
base: main
Are you sure you want to change the base?
Conversation
Should we keep the HashMap like this? Or should we use the trait system? or both? What direction should the lookup mechanism take? I personally would be alright with the current structure and a trait lookup mechanism, providing options would make the library more friendly for developers. |
I was thinking for the Refer to the record_sub_id’s requirement in description, though they point out agencies can add additional fields that might invalidate the specified requirements. |
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.
Thanks for the contribution!
Sorry for the time taken to review this, I don't have much time for the moment, and this is quite a big chunk to review 😁
by curiosity, why didn't you use the associated types used in @Tristramg POC? There are not convenient to use?
I'll try to properly review this a bit later, this is my notes after the first read.
let mut possible_translations:HashSet<(TranslatableField, LanguageTag)> = HashSet::new(); | ||
|
||
for row in raw_translations { | ||
if let Ok(language_tag) = LanguageTag::parse(row.language.as_str()) { |
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.
I know it's a POC, but I'll just add a comment to not forget that this should either stop on error or log something
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.
Got it, will do!
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.
This isn't a big issue to implement for us, because every agency I've seen so far does use valid language strings
raw_translations: Vec<RawTranslation>, | ||
) -> ( | ||
HashMap<TranslationLookup, String>, | ||
Vec<(TranslatableField, LanguageTag)> |
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.
I think I might be missing something, but I'm not really sure I understand why this TranslatableField
is used?
Can't we just have the HashMap<TranslationLookup, String>
Maybe it's because there isn't the translation mechanism yet (which is fine, but it makes it more difficult to understand this code)
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.
This creates the summary together because it's cleaner to do it in the same iter instead of writing a second iter in the primary gtfs. I can add some comments to explain what's going on if you'd like.
We plan on implementing traits properly in a bit |
|
||
//oh no... i need trip_id... but that's contained in the parent... | ||
|
||
// should I add trip_id to stop_times? |
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.
I need assistance here, can I add Arc to stop_times to allow headsign translation to work?
Los Angeles Metro and other agencies use dynamic headsigns that change along a route, thus translation of stop_times is important here.
CC: @antoine-de @Tristramg @CallMeJai @AndrewHC36
This is a collaborative effort between the Rust-Transit Maintainers and the Catenary Transit Initiatives https://catenarymaps.org team, a nonprofit designing open-source public transport software. We seek comments from the community and maintainers.
Team members responsible:
@CallMeJai @AndrewHC36 @kylerchin
Thank you to @Robbe7730 for the original idea of RawTranslations
THIS IS A WORK IN PROGRESS DRAFT AND WILL BE UNMARKED ONCE READY
This discussion originated at https://github.com/orgs/catenarytransit/discussions/2
Key points of discussion:
Final notes:
Note that as GTFS is an evolving specification, the contents of the translatable field will change over time.