Lack of interest Alternate Tag Separators

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

ibnesayeed

Well-known member
Currently, only one form of comma character is being used as the tag separator when adding tags in a thread. However, there are a few variations of the comma character that are being used by one language or the other. While entering tags, it is very inconvenient to switch keyboard to use the comma other than the current language. Wikipedia suggests three different commas (, ، 、). I would like to suggest inclusion of all of them as the tag separator. XenTag addon added support for the Arabic comma on request that is being used in many RTL languages. Recently, I have seen some long tags in our forum that have Arabic comma in it, but they were treated as a single tag.
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
Recently, I have seen some long tags in our forum that have Arabic comma in it, but they were treated as a single tag.
Hey @Mike and @Chris D this issue is an ongoing pain for our members and the staff. People use Urdu keyboard to write messages in our forum, which uses a different comma. As a result, in order to make use of this system properly they will have to switch the keyboard twice after every tag they enter, just for the comma entry. The experience is even worse on mobile devices. Also, many members don't even know that they are not using the right comma. Hence moderators end up editing them later. Additionally, if someone puts a comma at the end it becomes part of the tag.

Here is an example:
Code:
اردو،اردو زبان،اردو زبان کا فروغ،اردو کا فروغ،
People would expect it to be treated as:
Code:
اردو
اردو زبان
اردو زبان کا فروغ
اردو کا فروغ
But that ends up being a single tag.

Is there a quick fix/edit you might suggest for us to put in place before it is done more thoroughly in the system for the entire comma separator class or Unicode characters (which I think are not many, just three or four). In our forum we would like it to work for both English and Urdu comma (which is same as Arabic comma).
 
Last edited:
I'm not sure how well this will work with certain characters, but it may help. It's a code edit, unfortunately.

js/xenforo.tag.js

Find:
Code:
delimiter:","

Replace with:
Code:
delimiter:[",",";","،"]

That allows , ; and ، to be used as delimiters for tags.
 
An array of strings should work there but I haven't tested it. I was going by the documentation for the most recent version so it's possible it's a newer feature.

I'll try and test it and report back.
 
It is that library. I can't remember if we used the new version when we worked on XF 1.5. We may not have done as it was already working (mostly) as we wanted in XFMG 1.0.x at that point.

If you can't get the array of strings working we'll see about (but can't guarantee) including a newer version in the future.
 
If you can't get the array of strings working
Now that I understood the code, with my custom modification I can get it working. However, the changes will have to be applied each time I upgrade, the way I deal with this pagination workaround.
we'll see about (but can't guarantee) including a newer version in the future
Greatly appreciated!
It is that library. I can't remember if we used the new version when we worked on XF 1.5. We may not have done as it was already working (mostly) as we wanted in XFMG 1.0.x at that point.
I have verified that XenForo is using the old code:
PHP:
if (event.which==event.data.delimiter.charCodeAt(0) || event.which==13 ) {
Instead of:
PHP:
if (_checkDelimiter(event)) {
Which is now implemented like this:
PHP:
var _checkDelimiter = function(event){
    var flag = false;// defalut no match

    if(event.which == 13){// Enter
        flag = true;
    }

    $.each(event.data.delimiter ,function(index, value){
        if(event.which == value.charCodeAt(0)){// match data.delimiter Array
            flag = true;
        }
    });

    return flag;
}
It turns out that the new implementation is not backwards compatible as they are now only supporting array. It could have been easy for them to also support the single character string config. However, this should not be an issue as the functionality is only used internally by XF and not advertised as a feature to be used by others (I guess). If it is otherwise, checking the type of "event.data.delimiter" and putting conditional should do the trick to keep it backward config compatible.
 
Recognizing other separators in the backend core would be great as it is needed in many places such as when mentioning users like @Mike, the English comma behaves as expected, but when other types are commas are used, they are considered as part of the name.
 
Hey @Chris D we have migrated our forum to XF2.2 from XF1.5 recently. We are facing this issue again in the new system and we could not figure out (yet) what to do to allow tag entry to recognize other forms of tag separators.
 
Hello, with the use of a PC you can press Enter to validate each tag entry. I have not tried on a mobile phone.
It can help while waiting for a more lasting solution.
 
I made the following change manually:

Diff:
$ diff js/xf/token_input.js.back js/xf/token_input.js
10c10
<             tokens: [','],
---
>             tokens: [',', '،'],
361c361
< (jQuery, window, document);
\ No newline at end of file
---
> (jQuery, window, document);

And replicated this change manually to the corresponding minified and compiled JS files and got it working. I do not have a robust process in place to preserve these changes when the site will be upgraded though. I wish, this separator was added to the list of token separators in the XF core, which will benefit many languages like Arabic, Persian, Urdu, etc. without affecting any LTR languages, as they do not use this character for any other purposes.
 
Hello, with the use of a PC you can press Enter to validate each tag entry.
It would be difficult to educate users to use a different technique than what the XF system says and the intuition they have built from other places. The tag entry modal window has the following help text:
Multiple tags may be separated by commas.
 
Top Bottom