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
block_formats options not translated if using documented approach #9598
Comments
andrewnicols
added a commit
to andrewnicols/tinymce
that referenced
this issue
Apr 29, 2024
The `buildBasicSettingsDataset` call is used for: - `block_formats` - `font_family_formats` - `font_size_formats` The documented values for both `block_formats` and `font_family_formats` include a space between the `;` and the title, for example the default value in `block_formats` is: ``` Paragraph=p; Heading 1=h1; Heading 2=h2; Heading 3=h3; Heading 4=h4; Heading 5=h5; Heading 6=h6; ``` However the `split()` method in `SelectDatasets.ts` splits on the delimter, leading to values such as ` Heading 1=h1` which are then passed into the `process()` method which just split them on `=` leading to a title of ` Heading 1` (with leading whitespace) which does not match any valid translation. This patch modifies the `split()` method to trim the title component.
5 tasks
andrewnicols
added a commit
to andrewnicols/tinymce
that referenced
this issue
Apr 30, 2024
The `buildBasicSettingsDataset` call is used for: - `block_formats` - `font_family_formats` - `font_size_formats` The documented values for both `block_formats` and `font_family_formats` include a space between the `;` and the title, for example the default value in `block_formats` is: ``` Paragraph=p; Heading 1=h1; Heading 2=h2; Heading 3=h3; Heading 4=h4; Heading 5=h5; Heading 6=h6; ``` However the `split()` method in `SelectDatasets.ts` splits on the delimiter, leading to values such as ` Heading 1=h1` which are then passed into the `process()` method which just split them on `=` leading to a title of ` Heading 1` (with leading whitespace) which does not match any valid translation. This patch modifies the `split()` method to trim the title component. It also refactors the SelectDatasets module to move the configuration processing into a utility method, and allows it to be unit tested. Additionally any white-spare around the `=` or `;` leads to erroneous values, for example a value of: ``` Paragraph = p ; ``` Leads to: title: `Paragraph ` value: ` p ` And multiple contiguous spaces leads to additional values, for example: ``` 12pt 14pt 16pt 18pt ``` Leads to a set of values: - `12pt` - `` (empty value) - `14pt` - `16pt` - `18pt`
andrewnicols
added a commit
to andrewnicols/tinymce
that referenced
this issue
Apr 30, 2024
The `buildBasicSettingsDataset` call is used for: - `block_formats` - `font_family_formats` - `font_size_formats` The documented values for both `block_formats` and `font_family_formats` include a space between the `;` and the title, for example the default value in `block_formats` is: ``` Paragraph=p; Heading 1=h1; Heading 2=h2; Heading 3=h3; Heading 4=h4; Heading 5=h5; Heading 6=h6; ``` However the `split()` method in `SelectDatasets.ts` splits on the delimiter, leading to values such as ` Heading 1=h1` which are then passed into the `process()` method which just split them on `=` leading to a title of ` Heading 1` (with leading whitespace) which does not match any valid translation. This patch modifies the `split()` method to trim the title component. It also refactors the SelectDatasets module to move the configuration processing into a utility method, and allows it to be unit tested. Additionally any white-spare around the `=` or `;` leads to erroneous values, for example a value of: ``` Paragraph = p ; ``` Leads to: title: `Paragraph ` value: ` p ` And multiple contiguous spaces leads to additional values, for example: ``` 12pt 14pt 16pt 18pt ``` Leads to a set of values: - `12pt` - `` (empty value) - `14pt` - `16pt` - `18pt`
andrewnicols
added a commit
to andrewnicols/tinymce
that referenced
this issue
Apr 30, 2024
The `buildBasicSettingsDataset` call is used for: - `block_formats` - `font_family_formats` - `font_size_formats` The documented values for both `block_formats` and `font_family_formats` include a space between the `;` and the title, for example the default value in `block_formats` is: ``` Paragraph=p; Heading 1=h1; Heading 2=h2; Heading 3=h3; Heading 4=h4; Heading 5=h5; Heading 6=h6; ``` However the `split()` method in `SelectDatasets.ts` splits on the delimiter, leading to values such as ` Heading 1=h1` which are then passed into the `process()` method which just split them on `=` leading to a title of ` Heading 1` (with leading whitespace) which does not match any valid translation. This patch modifies the `split()` method to trim the title component. It also refactors the SelectDatasets module to move the configuration processing into a utility method, and allows it to be unit tested. Additionally any white-spare around the `=` or `;` leads to erroneous values, for example a value of: ``` Paragraph = p ; ``` Leads to: title: `Paragraph ` value: ` p ` And multiple contiguous spaces leads to additional values, for example: ``` 12pt 14pt 16pt 18pt ``` Leads to a set of values: - `12pt` - `` (empty value) - `14pt` - `16pt` - `18pt`
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
📝 Provide detailed reproduction steps (if any)
https://fiddle.tiny.cloud/Fug3lEC28d/0
block_formats
option of (exact copy from docs):format
menubar is present✔️ Expected result
All headings translated
❌ Actual result
Only paragraph is translated. Others are not
❓ Possible solution
I believe the following patch will solve the issue:
I haven't worked out where to write a unit test for this but happy to provide one.
📃 Other details
The text was updated successfully, but these errors were encountered: