Skip to content
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

feat(i18n): convert document actions strings to use i18n primitives #4968

Merged
merged 14 commits into from
Oct 13, 2023

Conversation

bjoerge
Copy link
Member

@bjoerge bjoerge commented Oct 3, 2023

Description

This converts various document action strings into 18n-keys

Also includes some minor cleanup. Commits can be reviewed one-by-one.

@bjoerge bjoerge requested review from rexxars and binoy14 October 3, 2023 12:23
@bjoerge bjoerge marked this pull request as ready for review October 3, 2023 12:23
@vercel
Copy link

vercel bot commented Oct 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Oct 12, 2023 7:50pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 12, 2023 7:50pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Oct 12, 2023 7:50pm

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

Package Documentation Change
sanity +16%
@sanity/types +3%
sanity/desk +2%
Full Report
sanity
This branch Next branch
127 documented 110 documented
847 not documented 834 not documented
@sanity/types
This branch Next branch
47 documented 46 documented
240 not documented 240 not documented
sanity/desk
This branch Next branch
84 documented 83 documented
56 not documented 55 not documented
@sanity/diff
This branch Next branch
13 documented 13 documented
16 not documented 16 not documented
@sanity/block-tools
This branch Next branch
4 documented 4 documented
9 not documented 9 not documented
@sanity/portable-text-editor
This branch Next branch
21 documented 21 documented
44 not documented 44 not documented
@sanity/mutator
This branch Next branch
7 documented 7 documented
4 not documented 4 not documented
@sanity/cli
This branch Next branch
1 documented 1 documented
30 not documented 30 not documented
@sanity/schema/_internal
This branch Next branch
0 documented 0 documented
9 not documented 9 not documented
@sanity/util/paths
This branch Next branch
1 documented 1 documented
15 not documented 15 not documented
sanity/router
This branch Next branch
15 documented 15 documented
21 not documented 21 not documented
@sanity/util/legacyDateFormat
This branch Next branch
0 documented 0 documented
3 not documented 3 not documented
@sanity/schema
This branch Next branch
0 documented 0 documented
2 not documented 2 not documented
sanity/cli
This branch Next branch
2 documented 2 documented
0 not documented 0 not documented
@sanity/vision
This branch Next branch
0 documented 0 documented
2 not documented 2 not documented
@sanity/util/fs
This branch Next branch
0 documented 0 documented
3 not documented 3 not documented
sanity/_internal
This branch Next branch
0 documented 0 documented
1 not documented 1 not documented
@sanity/util/content
This branch Next branch
1 documented 1 documented
5 not documented 5 not documented

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

Component Testing Report Updated Oct 12, 2023 7:52 PM (UTC)

File Status Duration Passed Skipped Failed
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 7s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 9s 3 0 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 10s 6 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 13s 9 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 46s 18 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 10s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 6s 3 0 0

Copy link
Member

@rexxars rexxars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should align on camelCase vs kebab-case for the i18n resources, eg action.delete.disabled.notReady vs action.delete.disabled.not-ready.

I am personally leaning towards kebab-case, but open to input.

'action.restore.label': 'Restore',

/** Fallback tooltip for when user is looking at the initial version */
'action.restore.disabled.cantRestoreInitial': "You can't restore to the initial version",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we do not use contractions in identifiers, so I would write this as action.restore.disabled.cannot-restore-initial

Copy link
Member Author

@bjoerge bjoerge Oct 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Fixed in 8dde36d

@bjoerge
Copy link
Member Author

bjoerge commented Oct 9, 2023

I am personally leaning towards kebab-case, but open to input.

Agree. Unless we think these will appear as object keys I don't see any point of using camel case

Copy link
Member

@rexxars rexxars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we agree, it would be great if you changed the keys here to be kebabcase, so action.restore.confirmDialog.confirmDiscardChanges => action.restore.confirmDialog.confirm-discard-changes etc.

@bjoerge bjoerge requested a review from rexxars October 11, 2023 22:11
@bjoerge
Copy link
Member Author

bjoerge commented Oct 11, 2023

Since we agree, it would be great if you changed the keys here to be kebabcase, so action.restore.confirmDialog.confirmDiscardChanges => action.restore.confirmDialog.confirm-discard-changes etc.

Fixed in c07fd19 - thanks for pointing out!

Copy link
Member

@rexxars rexxars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still seems to be using camelcase? Examples:

  • discardChanges => discard-changes
  • confirmDialog => confirm-dialog
  • notPublished => not-published
  • notReady => not-ready
  • nothingToDelete => nothing-to-delete

There's more, but you get the idea

@bjoerge
Copy link
Member Author

bjoerge commented Oct 12, 2023

🤦🏼

aight, new attempt. Also kebab-cased some existing keys for the publish action.

@rexxars rexxars merged commit cff28db into feat/i18n Oct 13, 2023
14 checks passed
@rexxars rexxars deleted the sdx-612 branch October 13, 2023 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants