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

Add word count type to each Locale #1482

Merged
merged 1 commit into from
Sep 10, 2022

Conversation

pedro-mendonca
Copy link
Member

What?

This PR adds the word_count_type to each locale. The default is 'words'.

Why?

The word count type can be used in the editor on submitting translations.
Related to #1478

Fixes #1481

@ocean90 ocean90 added this to the 4.0 milestone Sep 10, 2022
@ocean90 ocean90 merged commit 7625a8d into GlotPress:develop Sep 10, 2022
pedro-mendonca added a commit to pedro-mendonca/GlotPress that referenced this pull request Sep 10, 2022
@pedro-mendonca pedro-mendonca deleted the word-count-types branch September 12, 2022 07:52
ocean90 added a commit that referenced this pull request Oct 10, 2022
* Add characters and words counts to editor

* Fix coding standards

* Rever some css to minimize changes

* Update assets/js/editor.js

Use 'input' instead of 'change keyup paste'

Co-authored-by: Dominik Schilling <[email protected]>

* Update gp-templates/helper-functions.php

Use number_format_i18n()

Co-authored-by: Dominik Schilling <[email protected]>

* Update gp-templates/helper-functions.php

Use number_format_i18n()

Co-authored-by: Dominik Schilling <[email protected]>

* Use core Wordcound package

* Use only Wordcount package to count words and characters

Supports the words type set in the installed language

* Add translation ID to the textarea to fix unique IDs for multiple translations for the same original ID

* Fix WPCS

* Update counts for all textareas from an editor row

* Simplify jQuery

* Move counts HTML from PHP to JS to format all in one place.

* Use the new GP_Locale word_count_type property

Property added in #1482

* Render counts wrapper only if textarea is editable

Co-authored-by: Dominik Schilling <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add word_count_type for each locale
2 participants