Opened on 06/19/2017 at 02:07:26 PM

Closed on 07/07/2017 at 12:36:09 PM

#5331 closed change (fixed)

Add has_string to CMS

Reported by: juliandoucette Assignee: jsonesen
Priority: P3 Milestone:
Module: Sitescripts Keywords:
Cc: wspee, kvas, jsonesen, ire, saroyanm Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29469568/

Description

Background

We currently have a get_string funcion in adblockplus/cms. This is being used on adblockplus.org for menu links that appear on each page and do not need to be in each page's locale file. It would be useful to have a has_string function so that we could use get_string conditionally. e.g.

<title>
  {% if title %}{{ title }}{% endif %}
  {% if has_string('site_title', site) %} | {{ get_string('site_title', site) }}{% endif %}
</title>

Note: I'm not entirely sure has_string and get_string is the best way to go to define site wide strings because it requires that create and manage a locale file manually. I'm open to suggestion here.

What to change

Implement a global has_string function that accepts a string name and locale file and returns a boolean.

Attachments (0)

Change History (5)

comment:1 Changed on 06/20/2017 at 01:49:16 PM by kvas

  • Priority changed from Unknown to P3
  • Ready set

comment:2 Changed on 06/20/2017 at 02:09:49 PM by jsonesen

  • Owner set to jsonesen

comment:3 Changed on 06/20/2017 at 02:52:53 PM by jsonesen

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:4 Changed on 06/21/2017 at 10:47:01 AM by abpbot

A commit referencing this issue has landed:
Issue 5331 - Add has_string() default global...

comment:5 Changed on 07/07/2017 at 12:36:09 PM by kvas

  • Resolution set to fixed
  • Status changed from reviewing to closed

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from jsonesen.
 
Note: See TracTickets for help on using tickets.