# Duplicate Translation Constants

**URL:** <https://community.open-emr.org/t/duplicate-translation-constants/7846>\
**Category:** OpenEMR Development\
**Created:** [June 27, 2014, 3:32am UTC](https://community.open-emr.org/t/duplicate-translation-constants/7846 "2014-06-27T03:32:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [June 27, 2014, 3:32am UTC](https://community.open-emr.org/t/duplicate-translation-constants/7846/1 "2014-06-27T03:32:52Z")

</div>

**[yehster](https://sourceforge.net/u/yehster/)** wrote on [Friday, June 27, 2014](https://sourceforge.net/p/openemr/discussion/202506/thread/fe5c054b/#e9dd):

In both reviewing manually the google doc, and running a query on the demo server  
(I used this SQL statement)

select count(_), constant\_name from openemr.lang\_constants group by constant\_name having count(_) \> 1 order by count(\*) desc;

There are a number of duplicated constant\_names in the constants table.

I am guessing that this may cause some glitches with translations, but I’m not sure what the correct course of action is.

This is the list of duplicates

2 Priority  
2 Blood pressure  
2 Don’t Save  
2 Accept Payment for  
2 Category  
2 Search or Add Patient  
2 Review Of Systems  
2 Additional Notes:  
2 Diagnosis:  
2 To:  
2 Treatment:  
2 Gender  
2 Totals for  
2 Claim was generated to file  
2 Physical Exam  
2 Not Examined:  
2 From:  
2 Total for  
2 New Definition set added  
2 Printing skipped; see test output in  
2 Normal Cardiac Exam:  
2 Encounter  
2 Procedure Order  
2 Dictation:  
2 Left:  
2 English  
2 Error: passwords don’t match. Please check your typing.  
2 Reference Reason  
2 Claim  
2 and  
2 Normal Lung Exam:  
2 Generate Letter regarding

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [June 27, 2014, 3:52am UTC](https://community.open-emr.org/t/duplicate-translation-constants/7846/2 "2014-06-27T03:52:39Z")

</div>

**[blankev](https://sourceforge.net/u/blankev/)** wrote on [Friday, June 27, 2014](https://sourceforge.net/p/openemr/discussion/202506/thread/fe5c054b/#1297):

My guess is the “space” or " ".

During my efforts to translate I encountered many places with just a space at the end of a line. (After " . " or " : ")

Another observation is: There are many more words or parts of sentences with the same medical result. Words in Capitals or beginning with Capital or lower case, for the same words.

If you could make a Dictionary for Developers of what is used and what can be changed into…, it would result in a more consequent text for OpenEMR, but hard to stay in sync with the past versions of OpenEMR.

I just checked Gender and indeed twice available. 1. “Gender” 2. "Gender " just a small difference, but very important for the lay-out of the text.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [June 27, 2014, 5:39am UTC](https://community.open-emr.org/t/duplicate-translation-constants/7846/3 "2014-06-27T05:39:15Z")

</div>

**[bradymiller](https://sourceforge.net/u/bradymiller/)** wrote on [Friday, June 27, 2014](https://sourceforge.net/p/openemr/discussion/202506/thread/fe5c054b/#1ebf):

Hi,

Recommend verifying these to the list of constants in the following file:  
contrib/util/language\_translations/currentConstants.txt

For example, with “Priority”, one has a trailing space and the other does not, which shows up both in above file and if you look at the entries in phpmyadmin.

-brady  
[OpenEMR](http://www.open-emr.org/)

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [June 27, 2014, 5:51am UTC](https://community.open-emr.org/t/duplicate-translation-constants/7846/4 "2014-06-27T05:51:14Z")

</div>

**[bradymiller](https://sourceforge.net/u/bradymiller/)** wrote on [Friday, June 27, 2014](https://sourceforge.net/p/openemr/discussion/202506/thread/fe5c054b/#18e5):

Hi,

See below for some sql queries of interest. It appears we should have a BINARY in the query in the library/translation.inc.php (note that the constant\_name is collated in binary, but appear need to place BINARY in front of the variable, like so(I have not tested this):  
$sql="SELECT \* FROM lang\_definitions JOIN lang\_constants ON " .  
"lang\_definitions.cons\_id = lang\_constants.cons\_id WHERE " .  
“lang\_id=? AND constant\_name = BINARY ? LIMIT 1”;

This is where I saw some info on this:

> <https://stackoverflow.com/questions/12542889/mysql-5-5-losing-trailing-spaces-in-query>

BELOW ARE THE INTERESTING SQL QUERIES:  
select constant\_name from openemr.lang\_constants where constant\_name = “Priority”  
-\> ;  
±--------------+  
| constant\_name |  
±--------------+  
| Priority |  
| Priority |  
±--------------+  
2 rows in set (0.06 sec)

mysql\> select constant\_name from openemr.lang\_constants where constant\_name = "Priority "  
-\> ;  
±--------------+  
| constant\_name |  
±--------------+  
| Priority |  
| Priority |  
±--------------+  
2 rows in set (0.00 sec)

mysql\> select constant\_name from openemr.lang\_constants where constant\_name = BINARY "Priority "  
-\> ;  
±--------------+  
| constant\_name |  
±--------------+  
| Priority |  
±--------------+  
1 row in set (0.01 sec)

mysql\> select constant\_name from openemr.lang\_constants where constant\_name = BINARY “Priority”  
-\> ;  
±--------------+  
| constant\_name |  
±--------------+  
| Priority |  
±--------------+  
1 row in set (0.00 sec)

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [June 27, 2014, 5:58am UTC](https://community.open-emr.org/t/duplicate-translation-constants/7846/5 "2014-06-27T05:58:02Z")

</div>

**[yehster](https://sourceforge.net/u/yehster/)** wrote on [Friday, June 27, 2014](https://sourceforge.net/p/openemr/discussion/202506/thread/fe5c054b/#588e):

Of note, at least two constants are exact duplicates

select count(_), constant\_name from openemr.lang\_constants group by binary constant\_name having count(_) \> 1 order by count(\*) desc;

2 Don’t Save  
2 Error: passwords don’t match. Please check your typing.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [June 27, 2014, 11:43am UTC](https://community.open-emr.org/t/duplicate-translation-constants/7846/6 "2014-06-27T11:43:44Z")

</div>

**[blankev](https://sourceforge.net/u/blankev/)** wrote on [Friday, June 27, 2014](https://sourceforge.net/p/openemr/discussion/202506/thread/fe5c054b/#7390):

Best thing to do is take a peak into the translation table (Google translation sheet OpenEMR):

**Don’t Save**

is not the same as:

**Don’t Save**

for your second example there is the same backward slash before the apostrophe

but for OpenEMR it looks the same. I am not a programmer, so I can’t help you to find the correct query to distinguish these double translations. It used to be we needed a backward slash for special characters.

Let’s hope Brady finds some time to tell you what to do. Get the Backward slash in or get it out in OpenEMR. the slash seems there is no special need for the backward slash in modern OpenEMR.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [June 27, 2014, 4:06pm UTC](https://community.open-emr.org/t/duplicate-translation-constants/7846/7 "2014-06-27T16:06:05Z")

</div>

**[yehster](https://sourceforge.net/u/yehster/)** wrote on [Friday, June 27, 2014](https://sourceforge.net/p/openemr/discussion/202506/thread/fe5c054b/#93ff):

The issue seems to be that the backslash is being treated by the scripts which generate the constants as a distinct character when it should be “escaped out.” (It does in fact get escaped out when loaded in to the database.)

As an example, referenced in the code is this:

> onclick=“top.restoreSession()”\>[\<?php echo xlt('Don\'t Save'); ?\>]

The backslash from the code makes it into the constant definition in the spreadsheet

> <https://github.com/openemr/openemr/blob/master/interface/forms/dictation/new.php#L25>

> [{php} xl(“Don’t Save”,“e”); {/php}]

[https://github.com/openemr/openemr/blob/master/interface/forms/soap/templates/general\_new.html#L71](https://github.com/openemr/openemr/blob/master/interface/forms/soap/templates/general_new.html#L71)

But in this case, it’s generated without the backslash

After processing in the database things get duplicated.

I’m “post processing” definitions to remove duplicates in the system I’m working with to prevent ambiguity, and because the definitions seem to be repeated in the Google Doc, there is likely no real impact to users, but it is a bug of sorts.
