-
Notifications
You must be signed in to change notification settings - Fork 8
I18n pt2 #39
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
Open
LlGC-jop
wants to merge
8
commits into
UniversalViewer:astro2026
Choose a base branch
from
LlGC-jop:i18n-pt2
base: astro2026
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+961
−133
Open
I18n pt2 #39
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
968235f
Localise calendar for CY by making it a component
LlGC-jop 7d6646f
Docs page in CY
LlGC-jop be62e71
i18n of community page, calendar component
LlGC-jop 13e04c9
create data alias
LlGC-jop e48db01
move demo collections to shared data dir & update main demo page
LlGC-jop a57aece
create cy demo, with way to set locale on the UV for other langs. adj…
LlGC-jop 6590dd0
update text to cy
LlGC-jop d4e3e9f
remove events calendar from community page as per #1673
LlGC-jop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| import type { Lang } from '@i18n/ui'; | ||
|
|
||
| const locale = Astro.currentLocale as Lang; | ||
| --- | ||
| <div class="calendar-embed"> | ||
| <iframe src={`https://calendar.google.com/calendar/embed?height=600&wkst=1&ctz=Europe%2FLondon&showPrint=0&showTitle=0&showTabs=0&showCalendars=0&src=dW5pdmVyc2Fsdmlld2VyYXBwQGdtYWlsLmNvbQ&color=%239e69af&hl=${locale}`} | ||
| /> | ||
| </div> |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,25 @@ | ||
| export const uvLocales = { | ||
| export const uvLocaleStrings = { | ||
| en: 'en-GB:English+(GB),cy-GB:Cymraeg,fr-FR:Français+(FR),pl-PL:Polski,sv-SE:Svenska', | ||
| cy: 'cy-GB:Cymraeg,en-GB:English+(GB),fr-FR:Français+(FR),pl-PL:Polski,sv-SE:Svenska', | ||
| }; | ||
| }; | ||
|
|
||
| const uvLocales = [ | ||
| { name: 'en-GB' }, | ||
| { name: 'cy-GB' }, | ||
| { name: 'fr-FR' }, | ||
| { name: 'pl-PL' }, | ||
| { name: 'sv-SE' }, | ||
| ]; | ||
|
|
||
| export function getLocalesForUV(currentLocale: string): Array<{ name: string }> { | ||
| const sortedLocales = [...uvLocales].sort((a, b) => { | ||
| const aMatch = a.name.startsWith(currentLocale); | ||
| const bMatch = b.name.startsWith(currentLocale); | ||
|
|
||
| if (aMatch && !bMatch) return -1; | ||
| if (!aMatch && bMatch) return 1; | ||
| return 0; | ||
| }); | ||
|
|
||
| return sortedLocales; | ||
| } |
File renamed without changes.
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
Oops, something went wrong.
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.
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 definitely think refactoring the calendar to a component is a good idea, but I'm not sure if we really want to use it here -- there was discussion on #1673 about replacing the duplicate embedded calendar with a link. What do you think about that?
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 don't have strong feelings - the main reason for making it a component was to allow for a locale change and to remove the duplication between En and Cy, so I'm happy either way.
I'll take it out so we can see how the page looks without.
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.
It's also fine to just leave it as-is here since it's a straight refactor, and to worry about replacing the component with a link as a separate PR in response to the open issue (which I should have linked in full earlier: UniversalViewer/universalviewer#1673).