gocodebox / lifterlms

LifterLMS, a WordPress LMS Solution: Easily create, sell, and protect engaging online courses.
https://lifterlms.com
GNU General Public License v3.0
181 stars 135 forks source link

Missing string localized for trial orders #731

Open Mte90 opened 5 years ago

Mte90 commented 5 years ago

1. Reproduction Steps

2. Expected Behavior

3. Actual Behavior

immagine

thomasplevy commented 5 years ago

Currently using raw get() methods from order meta data:

https://github.com/gocodebox/lifterlms/blob/master/templates/myaccount/view-order.php#L72 https://github.com/gocodebox/lifterlms/blob/master/templates/myaccount/view-order.php#L110 https://github.com/gocodebox/lifterlms/blob/master/templates/myaccount/view-order.php#L112

These functions should be using a method similar to whats found on the LLMS_Access_Plan model:

get_access_period_name(): https://github.com/gocodebox/lifterlms/blob/master/includes/models/model.llms.access.plan.php#L93

get_schedule_details(): https://github.com/gocodebox/lifterlms/blob/master/includes/models/model.llms.access.plan.php#L372

get_trial_details(): https://github.com/gocodebox/lifterlms/blob/master/includes/models/model.llms.access.plan.php#L407

These functions can likely be abstracted into classless functions which can be used by the existing plan methods and also by this template as well as pricing table templates and so on.

Mte90 commented 5 years ago

I was expecting that they was localized, maybe use __() also for this strings and fix easily?

thomasplevy commented 5 years ago

@Mte90 yep, it's a bug, I neglected to use l10n functions. We'll refactor to use them. It's unfortunately a bit more difficult since the terms are variable (year, month, day, week) and you can't just drop a database call variable into __() and expect it to work right. Then you also need to consider plurals.

We'll fix it for sure but sorry it's not a simple one liner.

eri-trabiccolo commented 4 years ago

HS-122081