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

Localize more items #680

Merged
merged 7 commits into from
Jan 25, 2024
Merged

Localize more items #680

merged 7 commits into from
Jan 25, 2024

Conversation

jpenna
Copy link
Contributor

@jpenna jpenna commented Jan 19, 2024

This is related to the PR AppFlowy-IO/AppFlowy#4426

It should be merged before the one in the app is merged.


I'm also doing the PT-BR translation in this PR to verify all texts are correctly replaced.

@CLAassistant
Copy link

CLAassistant commented Jan 19, 2024

CLA assistant check
All committers have signed the CLA.

@LucasXu0 LucasXu0 marked this pull request as draft January 20, 2024 15:38
@LucasXu0
Copy link
Collaborator

Hi, @jpenna. I converted it to a draft PR. Please mark it as ready for review if it's ready.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I renamed the icons for text_direction_right and left to text_direction_ltr and rtl, respectively. The meaning of the image is clearer this way and they were actually used with the opposite command.

@@ -1,79 +1,42 @@
{
"@@locale": "en",
"bold": "Bold",
"@bold": {},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed these metadatas because they were useless bloat in these situations.

Comment on lines +122 to +129
"cmdDontAddNewLineInTableCell": "Don't add new line in table cell",
"cmdMoveToLeftCellIfItsAtStartOfCurrentCell": "Move to left cell if its at start of current cell",
"cmdMoveToRightCellIfItsAtTheEndOfCurrentCell": "Move to right cell if its at the end of current cell",
"cmdMoveToUpCellAtSameOffset": "Move to up cell at same offset",
"cmdMoveToDownCellAtSameOffset": "Move to down cell at same offset",
"cmdNavigateAroundTheCellsAtSameOffset": "Navigate around the cells at same offset",
"cmdNavigateAroundTheCellsAtSameOffsetInReverse": "Navigate around the cells at same offset in reverse",
"cmdStopAtTheBeginningOfTheCell": "Stop at the beginning of the cell"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These will be useful for AppFlowy-IO/AppFlowy#4426

Comment on lines +44 to +60
? AppFlowyEditorL10n.current.colAddBefore
: AppFlowyEditorL10n.current.rowAddBefore,
dir == TableDirection.col
? Icons.last_page
: Icons.vertical_align_bottom, () {
TableActions.add(node, position + 1, editorState, dir);
? Icons.first_page
: Icons.vertical_align_top, () {
TableActions.add(node, position, editorState, dir);
dismissOverlay();
}),
_menuItem(
context,
dir == TableDirection.col
? AppFlowyEditorL10n.current.colAddBefore
: AppFlowyEditorL10n.current.rowAddBefore,
? AppFlowyEditorL10n.current.colAddAfter
: AppFlowyEditorL10n.current.rowAddAfter,
dir == TableDirection.col
? Icons.first_page
: Icons.vertical_align_top, () {
TableActions.add(node, position, editorState, dir);
? Icons.last_page
: Icons.vertical_align_bottom, () {
TableActions.add(node, position + 1, editorState, dir);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the order of these two, so "add before" comes before "add after", which makes more sense.

@@ -251,7 +251,7 @@ class _TableBlockComponentWidgetState extends State<TableBlockComponentWidget>
}

SelectionMenuItem tableMenuItem = SelectionMenuItem(
name: AppFlowyEditorL10n.current.table,
getName: () => AppFlowyEditorL10n.current.table,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A better way to achieve this same thing would be to rebuild everything if Intil changes, but then it would require a long refactor of many classes to use Localizations.of(context) or add some listener to rebuild everything. Probably something to be thought about later?

@jpenna jpenna marked this pull request as ready for review January 20, 2024 18:05
@jpenna jpenna marked this pull request as draft January 20, 2024 18:07
@jpenna jpenna marked this pull request as ready for review January 20, 2024 18:09
@jpenna
Copy link
Contributor Author

jpenna commented Jan 20, 2024

I'll send another PR with the translations of commands. It will be quite large, so we can merge this one first.

@LucasXu0
Copy link
Collaborator

@jpenna One test failed. Please check it.

Copy link

codecov bot commented Jan 25, 2024

Codecov Report

Attention: 71 lines in your changes are missing coverage. Please review.

Comparison is base (3cd5602) 76.46% compared to head (0a3a92e) 76.39%.

Files Patch % Lines
lib/src/l10n/l10n.dart 15.38% 33 Missing ⚠️
...omponent/table_block_component/table_commands.dart 0.00% 14 Missing ⚠️
...itor/toolbar/desktop/items/utils/tooltip_util.dart 47.82% 12 Missing ⚠️
...onent/table_block_component/table_action_menu.dart 0.00% 8 Missing ⚠️
...nent/service/shortcuts/command_shortcut_event.dart 0.00% 1 Missing ⚠️
...c/editor/selection_menu/selection_menu_widget.dart 50.00% 1 Missing ⚠️
...toolbar/desktop/items/alignment_toolbar_items.dart 0.00% 1 Missing ⚠️
...ar/desktop/items/text_direction_toolbar_items.dart 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #680      +/-   ##
==========================================
- Coverage   76.46%   76.39%   -0.08%     
==========================================
  Files         295      295              
  Lines       13094    13309     +215     
==========================================
+ Hits        10012    10167     +155     
- Misses       3082     3142      +60     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@LucasXu0 LucasXu0 merged commit 7fe3ff7 into AppFlowy-IO:main Jan 25, 2024
8 of 11 checks passed
@jpenna jpenna deleted the a4276-translations branch January 25, 2024 16:55
q200892907 added a commit to q200892907/appflowy-editor that referenced this pull request Jan 26, 2024
* main:
  fix: pasting keeps current node type (AppFlowy-IO#689)
  chore: localize more items (AppFlowy-IO#680)
  fix: windows chinese ime issue (AppFlowy-IO#682)
  fix: upgrade markdown to 7.2.1 (AppFlowy-IO#686)
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