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

Support translation for segment anniversary filters #7228

Open
wants to merge 56 commits into
base: staging
from

Conversation

1 participant
@kuzmany
Copy link
Contributor

kuzmany commented Feb 8, 2019

Please be sure you are submitting this against the staging branch.

Q A
Bug fix?
New feature?
Automated tests included?
Related user documentation PR URL
Related developer documentation PR URL
Issues addressed (#s or URLs)
BC breaks?
Deprecations?

Description:

This PR is related to already merged to #6993
We've added support for anniversary, but now need support for translated anniversary filter.

If you're using english language:

  • anniversary
  • anniversary -1 day

If you're using french language, you are able to use these format:

  • anniversary
  • anniversary -1 day
  • anniversaire
  • anniversaire -1 day

This PR bring new DateRelativeParser (tests include) https://github.com/mautic/mautic/pull/7228/files#diff-bbfe9f8aca314124ce61104c7207459b
That classes also use in another PR #6710
Class parse string based on own dictionary or related date start with +/-.

Steps to test this PR:

  1. Load up this PR
  2. Create custom contact date field
  3. Add two contacts. If today is 8. 2. 2019, then
  • first contact has custom date field set to 2019-02-08
  • second contact has custom date field set to 2019-02-07
  1. Create two segments with Custom date field equal
  • anniversary
  • anniversary -1 day
  1. Wait for segments rebuild and see If contacts was added to segments correctly
    Devs can also check logs on dev enviroment

I see for first segment

image

For second segment
image
6. Then remove segments and switch Mautic to french language
7. Create same two segments as above + create additional two segments with french language in filter:

  • anniversary
  • anniversary -1 day
  • anniversaire
  • anniversaire -1 day
  1. Wait to segments rebuild and see If contacts was assigned to all four segments what you created

kuzmany added some commits Oct 10, 2018

Comments
Move stuff to abstract class
clean comments
replace leads with options
Some fixes
Change regex

@kuzmany kuzmany added this to the 2.16.0 milestone Feb 8, 2019

@kuzmany kuzmany referenced this pull request Feb 11, 2019

Open

Contact Token replacer #6710

kuzmany added some commits Feb 11, 2019

Revert "Merge branch 'token-helper-replace' into support-language-seg…
…ment-anniversary-filter"

This reverts commit 20237fc, reversing
changes made to 159c226.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.