Add support for translations.txt to gtfs-schedule module#37
Merged
Conversation
🤖 Generated with [GitHub Copilot](https://copilot.github.com) Co-Authored-By: GitHub Copilot <noreply@github.com> Co-authored-by: sargunv <1320357+sargunv@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for translations.txt in gtfs-schedule module
Add support for translations.txt to gtfs-schedule module
Oct 23, 2025
sargunv
approved these changes
Oct 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for the
translations.txtfile to the gtfs-schedule module, following the GTFS Schedule reference specification.Changes
New Model: Translation
Added a new
Translationdata class representing records in thetranslations.txtfile with all seven fields from the GTFS specification:Required fields:
tableName- Defines the table containing the field to be translatedfieldName- Name of the field to be translatedlanguage- Language code for the translation (usingLanguageCodetype)translation- The translated valueOptional fields:
recordId- Identifies the record containing the field to be translated (first or only field of table's primary key)recordSubId- Additional identifier for tables without unique IDs (second field of table's primary key)fieldValue- Alternative to record identifiers; applies translation when field contains this exact valueTesting
Added comprehensive test coverage in
TranslationTest.ktdemonstrating all usage patterns:recordId(e.g., translating agency name)recordSubId(e.g., translating stop name with composite key)fieldValue(e.g., translating headsign text)Documentation
Added
translations.txtto the TODO list inProducerTest.ktfor finding sample datasets that publish translation data.Implementation Notes
The implementation follows all existing patterns in the codebase:
@Serializablefor CSV parsing with kotlinx-serializationLanguageCodefrom utils)This enables applications using the library to parse and utilize multilingual GTFS datasets that provide translations for customer-facing text.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.