Forum

Thread tagged as: Problem, Discussion

Core & Addons localization - missing some strings

Most of the UI elements are localized when adding the translation file(s), but there are a few minor elements that would require changes in some of /modes/somefile.php files to display the localized string.

It's not an issue of strings missing from the latest available translation file(Perch 2.4.7), I included the new ones (2.5.4).

There's no git repository to submit issues, so how can I help or do to submit the changes?

A few examples of the issue:

  • Pages -> Master Pages Edit -> "Template Refrence" select box
  • Blog -> Comments -> smartbar filter list: "Live", "Rejected", "Spam
Andrés Fernández

Andrés Fernández 5 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

All the UI Translations are in GitHub, does that answer your question?

https://github.com/PerchCMS/Perch2-UI-Translations

I downloaded the translation files from that repo, I added the all missing strings and there were still a few elements that displayed in English.

So I looked at the code and the elements I refer to don't use the PerchLang class to output the translated string.

Drew McLellan

Drew McLellan 2638 points
Perch Support

If you let us know what they are, we'll get them fixed.

Only reading English, they're hard for me to spot.

Is it ok if I post extracts of code in the forum? I'll post one as example and edit later if it's allowed

/perch/core/apps/content/modes/page.edit.post.php#L31

    <ul class="smartbar">
-        <li><a href="<?php echo PERCH_LOGINPATH . '/core/apps/content/page/?id='.PerchUtil::html($Page->id());?>">Regions</a></li>
+        <li><a href="<?php echo PERCH_LOGINPATH . '/core/apps/content/page/?id='.PerchUtil::html($Page->id());?>"><?php echo PerchLang::get('Regions'); ?></a></li>
Drew McLellan

Drew McLellan 2638 points
Perch Support

Simpler just to just post the URL and the string - thanks.

Core

One of the privileges title in the edit role form Users > Roles > Privileges > Assets: "Upload assets"

/perch/core/apps/assets/modes/_smart_bar.php#L54 the 'Search' placeholder

/perch/core/apps/content/modes/page.edit.post.php#L31 'Regions'

/perch/core/apps/content/modes/template.edit.post.php

  • L31: 'Do not copy'
  • L49: 'Reference this master page'
  • L50: 'Copy this master page'

/perch/core/settings/modes/basic.post.php

  • L78: 'Dark text for light background colours'
  • L79: 'Light text for dark background colours'

There's also an issue with templates type file and image, the "Select or upload ..." anchor that opens the assets panel when clicked.

The span element is added before the lang strings are loaded, so they are not localized. /perch/core/assets/js/assets.js#L48-58

Blog

/perch_blog/modes/list.post.php

  • L114 & L116: $Post->postStatus() ('Draft', 'Published')

/perch_blog/modes/edit.post.php

  • L80: 'Default' label
  • L113: 'Draft' label
  • L114: 'Published' label

/perch_blog/modes/comments.list.post.php

  • L43: 'Live'
  • L49: 'Rejected'
  • L55: 'Spam'

Gallery

/perch_gallery/modes/images.list.post.php

  • L71: 'Delete' label

That's it for today have a good weekend

Core

Missed the 'Toggle sidebar' string in the topbar.

Members

/perch_members/modes/members.edit.post.php

  • L30: 'Pending' label
  • L31: 'Active' label
  • L32: 'Inactive' label

Events

no issues

Forms

no issues

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Thanks Andres,

we''ll log these and take a look for the next release.

I missed a few

Core

/perch/core/apps/content/modes/regions.options.post.php

  • L37: 'Regions'
  • L49: 'Reorder'
Drew McLellan

Drew McLellan 2638 points
Perch Support

Thank you

In 2.7.10:

Strings on /perch/core/assets/js/repeaters.js,
solved it locally wrapping the init calls in head.ready(['lang]).

Drew McLellan

Drew McLellan 2638 points
Perch Support

Good catch - thank you.

core/apps/content/modes/region.itemlist.post.php line 57:

?>">Regions</a> 
Drew McLellan

Drew McLellan 2638 points
Perch Support

Thank you!