-
Notifications
You must be signed in to change notification settings - Fork 18
Mobile: Add simple layout grid controls #187
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
Changes from 1 commit
260fc32
1e3141d
987be10
4f60830
b8e942a
ff76727
810ea7d
4b6a12c
c11ebf1
77c8557
6af5124
14b0f2c
c972434
cbfb7c8
872491d
2698020
3368ba1
22742d2
a3dee8c
949f23a
6188f5e
98d682d
b579c3b
0179a6d
f37bdf3
b56a9af
b934d40
a26c456
77f9503
cf985cb
bf0ac0a
b14290d
9128940
b22e86b
e13809b
99fc7f7
fea7ca5
a0bb417
cde6157
e5671d7
2a19368
2261831
476b18c
83897ad
3ef4a45
831f521
d1fb1c5
67f08f3
5e6919c
317aeac
7af39b0
34945d8
9244271
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| /** | ||
| * WordPress dependencies | ||
| */ | ||
| import { __ } from '@wordpress/i18n'; | ||
|
|
||
| /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ | ||
|
|
||
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import ColumnIcon from './../icons'; | ||
| /** | ||
| * Template option choices for predefined columns layouts. | ||
| * | ||
| * @type {WPBlockVariation[]} | ||
| */ | ||
| const variations = [ | ||
| { | ||
| name: 'one-column', | ||
| title: __( 'One' ), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm working on adding i18n support for the Layout Grid block and I bumped into a case where these strings Not sure if it's an issue because I couldn't find the translations on either of both GlotPress projects (Gutenberg / Layout Grid) or it's expected to use the default domain, @enejb I'd appreciate it if you could provide further insights regarding this, thanks!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think for one reason or another I thought that in Gutenberg we had the values translated. So I left them as they were taking the value from core. Since we didn’t translate blocks that were not living outside of Gutenberg. (. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great, thank you very much for info 🙇 !
Yep, I was also surprised that number strings like "One" / "Two" aren't translated in Gutenberg, however, I noticed that we actually have them but with a dot at the end (i.e. "One.") 😅 .
This is part of the work I'm doing for the Translation Pipeline Improvement project, although for the strings that are used only in the native version of the editor, they are currently being translated as part of the WordPress app.
Ok, it's still unclear to me whether to use a domain or not within plugins, per this documentation about plugin translations, I understand that it's recommended to use a domain but I guess it's ok to fall back to default (Gutenberg in this case) if we know that the string is present there. In any case, with the work I'm doing for the pipeline improvements, these strings will be added to the localization strings files and translated as strings of the WordPress app (example reference). |
||
| description: __( 'One column', 'layout-grid' ), | ||
| icon: ( <ColumnIcon columns={ 1 } /> ), | ||
| isDefault: true, | ||
| innerBlocks: [ [ 'jetpack/layout-grid-column' ] ], | ||
| scope: [ 'block' ], | ||
| }, | ||
| { | ||
| name: 'two-columns', | ||
| title: __( 'Two' ), | ||
| description: __( 'Two columns', 'layout-grid' ), | ||
| icon: ( <ColumnIcon columns={ 2 } /> ), | ||
| innerBlocks: [ | ||
| [ 'jetpack/layout-grid-column' ], | ||
| [ 'jetpack/layout-grid-column' ], | ||
| ], | ||
| scope: [ 'block' ], | ||
| }, | ||
| { | ||
| name: 'three-columns', | ||
| title: __( 'Three' ), | ||
| description: __( 'Three columns', 'layout-grid' ), | ||
| icon: ( <ColumnIcon columns={ 3 } /> ), | ||
| innerBlocks: [ | ||
| [ 'jetpack/layout-grid-column' ], | ||
| [ 'jetpack/layout-grid-column' ], | ||
| [ 'jetpack/layout-grid-column' ], | ||
| ], | ||
| scope: [ 'block' ], | ||
| }, | ||
| { | ||
| name: 'four-columns', | ||
| title: __( 'Four' ), | ||
| description: __( 'Four columns', 'layout-grid' ), | ||
| icon: ( <ColumnIcon columns={ 4 } /> ), | ||
| innerBlocks: [ | ||
| [ 'jetpack/layout-grid-column' ], | ||
| [ 'jetpack/layout-grid-column' ], | ||
| [ 'jetpack/layout-grid-column' ], | ||
| [ 'jetpack/layout-grid-column' ], | ||
| ], | ||
| scope: [ 'block' ], | ||
| }, | ||
| ]; | ||
|
|
||
| export default variations; | ||
Uh oh!
There was an error while loading. Please reload this page.