Skip to content

Create I18n_Usage_Check #18

Closed
Closed

Description

@mehulkaklotar

Description

Checks that WordPress internationalization functions are used properly, including using a valid textdomain that matches the plugin’s textdomain in the main file comment header. It will also include checks for each of the localization functions for typos and ensure the correct parameters are passed. This will use the existing WordPress.WP.I18n sniff in the WordPress Coding Standards.

Acceptance Criteria

  • Class I18n_Usage_Check should be created and exists at includes/Checker/Checks
  • Class I18n_Usage_Check should extend the Abstract_PHP_CodeSniffer_Check abstract class
  • Class should implement the public get_args() and return an associative array of the required PHPCS arguments
    • 'sniffs' => 'WordPress.WP.I18n'
    • 'standard' => 'WordPress'

Tests Coverage

  • get_args() method returns the expected array of PHPCS arguments for the check
  • run() method adds a correct message to the $check_result when checking an invalid file
  • run() method does not add any message to the $check_result when checking a valid file

Activity

  1. added
    [Type] Enhancement
    Checks
    Infrastructure
    and removed
    Infrastructure
    on Nov 23, 2022
  2. moved this from Backlog to Definition in Plugin Checkon Nov 29, 2022
  3. moved this from Definition to Backlog in Plugin Checkon Dec 7, 2022
  4. moved this from Backlog to Definition in Plugin Checkon Dec 8, 2022
  5. moved this from Definition to Backlog in Plugin Checkon Dec 8, 2022
  6. moved this from Backlog to Definition in Plugin Checkon Dec 9, 2022
  7. self-assigned this
    on Dec 9, 2022
  8. removed their assignment
    on Dec 9, 2022
  9. 7 remaining items

  10. jjgrainger commented on Jan 17, 2023

    @jjgrainger
    Contributor

    Thanks @felixarntz

    I've updated the AC's to reflect the changes made to the Abstract_PHPCodeSniffer_Check.

  11. moved this from In Progress to AC Review in Plugin Checkon Jan 18, 2023
  12. felixarntz commented on Jan 18, 2023

    @felixarntz
    Member

    @jjgrainger ACs LGTM!

  13. moved this from AC Review to To Do in Plugin Checkon Jan 18, 2023
  14. vishalkakadiya commented on Jan 21, 2023

    @vishalkakadiya

    @jjgrainger Added a standard argument in the task description as we need to test the translation logic against WP coding standards. Let me know if you have any other suggestions, thank you!

    CC @felixarntz

  15. moved this from To Do to Code Review in Plugin Checkon Jan 23, 2023
  16. vishalkakadiya commented on Jan 25, 2023

    @vishalkakadiya

    @jjgrainger I have addressed your feedback and left one question for you. Thank you!

  17. modified the milestones: Sprint 3, Sprint 4 on Jan 31, 2023
  18. moved this from Code Review to Done in Plugin Checkon Feb 3, 2023
  19. added 2 commits that reference this issue on Sep 13, 2023
    ee56bc2
    c13cd83
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Checks[Type] Enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions