Skip to content

Commit

Permalink
Merge branch 'dev' into itinerary-style-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
binh-dam-ibigroup authored Oct 18, 2023
2 parents 21306af + b2dedb4 commit 5ff28b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/components/mobile/location-search.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { connect } from 'react-redux'
import { injectIntl } from 'react-intl'
import {
MenuItemA,
MenuItemLi,
MenuItemList
} from '@opentripplanner/location-field/lib/styled'
Expand All @@ -20,7 +19,7 @@ const MobileLocationField = styled(LocationField)`
${MenuItemList} {
width: 100%;
}
${MenuItemA}, ${MenuItemLi} {
${MenuItemLi} {
overflow: hidden;
padding-left: 5px;
padding-right: 5px;
Expand Down
8 changes: 6 additions & 2 deletions lib/util/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ async function loadOtpUiLocaleData(matchedLocale) {
*/
export async function loadLocaleData(matchedLocale, customMessages) {
let messages
let otpUiLocale = matchedLocale
switch (matchedLocale) {
case 'es': // Spanish translation is not specific to a region
messages = await import('../../i18n/es.yml')
Expand All @@ -130,15 +131,18 @@ export async function loadLocaleData(matchedLocale, customMessages) {
case 'vi': // Vietnamese translation is not specific to a region
messages = await import('../../i18n/vi.yml')
break
case 'zh': // Chinese translation is not specific to a region
case 'zh': // Chinese (Simplified) translation is not specific to a region
messages = await import('../../i18n/zh.yml')
// The OTP-UI files for Chinese (Simplified) are (correctly) named `zh_Hans`.
// TODO: Rename this repo's zh files to zh_Hans
otpUiLocale = 'zh_Hans'
break
default:
messages = await import('../../i18n/en-US.yml')
break
}

const otpUiMessages = await loadOtpUiLocaleData(matchedLocale)
const otpUiMessages = await loadOtpUiLocaleData(otpUiLocale)

// Merge custom strings into the standard language strings.
const mergedMessages = {
Expand Down

0 comments on commit 5ff28b0

Please sign in to comment.