Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up704: Add glossary tooltips after editing a row. #705
Conversation
@@ -315,6 +317,12 @@ public function translations_post( $project_path, $locale_slug, $translation_set | |||
$translations = GP::$translation->for_translation( $project, $translation_set, 'no-limit', array('translation_id' => $translation->id), array() ); | |||
|
|||
if ( ! empty( $translations ) ) { | |||
if ( $glossary ) { | |||
require_once GP_TMPL_PATH . 'helper-functions.php'; |
ocean90
Apr 30, 2017
Member
Since map_glossary_entries_to_translations_originals()
is currently a template function there's no guarantee that the function exists. Maybe it shouldn't be a template function? Would gp-includes/template.php
be a better place?
Since map_glossary_entries_to_translations_originals()
is currently a template function there's no guarantee that the function exists. Maybe it shouldn't be a template function? Would gp-includes/template.php
be a better place?
toolstack
May 1, 2017
Author
Contributor
I think it should be a template function as it's creating html for the front end to use. A custom template might want to change it from a tooltip to something else and need different markup to do it.
I'd say if someone has created a new theme and template functions that it would have to support all functions in the helper file to properly support outputting the glossary markup.
The other way to do this, which might be logically cleaner, would be to create a new template "translation-row-ajax.php" which would call map_glossary_entries_to_translations_originals()
from inside of it to keep all of the template logic inside the template directory.
I think it should be a template function as it's creating html for the front end to use. A custom template might want to change it from a tooltip to something else and need different markup to do it.
I'd say if someone has created a new theme and template functions that it would have to support all functions in the helper file to properly support outputting the glossary markup.
The other way to do this, which might be logically cleaner, would be to create a new template "translation-row-ajax.php" which would call map_glossary_entries_to_translations_originals()
from inside of it to keep all of the template logic inside the template directory.
Closing in favor of #716. |
toolstack commentedApr 27, 2017
Resolves #704.