Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Empty / Blank Strings - Dont re-load origin string if string saved as empty #335

Open
dieskim opened this issue Sep 11, 2018 · 4 comments

Comments

@dieskim
Copy link

dieskim commented Sep 11, 2018

Steps to reproduce the issue

  1. Open a component language file
  2. save a string as blank / empty
  3. Load the language file again to edit other strings

Expected result

  1. Strings saved as blank/empty remains blank

Actual result

  1. String re-loads from origin file

Additional comments

  1. There are use cases for blank/empty language strings as some languages dont need all language strings and can simple have them empty
@infograf768
Copy link
Contributor

will test asap.

@infograf768
Copy link
Contributor

@dieskim

I confirm your findings. Not sure we should consider it as an issue.
A simple way to get rid of the problem in your case is to enter a space in the field.
In this case, com_localise will consider the field as translated.

@dieskim
Copy link
Author

dieskim commented Sep 18, 2018

@infograf768 - yes I can use a space, but then the space gets output in the actual output code, and this can at times get pretty ugly, espessially if you have two or 3 language strings next to each other

If for Example:

$chapterTitle = JText::_('COM_CHAPTER_TITLE_PREFIX_SEPERATOR') . JText::_('COM_CHAPTER_TITLE_SEPERATOR') . JText::_('COM_CHAPTER_TITLE_CHAPTERNAME') . $chapterNumber;

In something like that you will now have 3 spaces if we have to use spaces - then the $chapterNumber - but if we use blank(null) we can use any combination, 1 , 2, 3 or non and have no spaces.

A simple fix would be to add a global config that we can enable to ignore and not reload blank values?

@infograf768
Copy link
Contributor

I then suggest you use ​ the zero width space: https://www.fileformat.info/info/unicode/char/200B/index.htm in the field. It should work for your needs.

I used it below between separator and 12

separator​12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants