Fix some obvious issues and implement some new features #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @lucaboesch ,
We are from the Open University and would like to propose the following changes:
To begin with, during our smoke testing of your plugin, we identified 2 obvious issues:
Issue 1
• Step to reproduce:
Please refer to this: https://drive.google.com/file/d/1-E0_tHnqN4ClzhnjCfQYzp-qRwIJwY9p/view?usp=sharing
• Expected outcome:
There is no conflict when viewing sourcecode and the behaviour should be the same as when the highlight setting is enabled.
Issue 2
• Step to reproduce:
Please refer to this: https://drive.google.com/file/d/1FEcG8RtmsZLLEcFOoZkMv1wX24pTrSky/view?usp=sharing
• Expected outcome:
The styling of the language tags should apply accordingly based on the ‘CSS for language tag’ setting.
In this commit, I have addressed 2 of the above issues. Additionally, I have implemented some of new feature as outlined:
1. Implement adding languages manually in the plugin setting.
Currently, Based on requirements of https://moodle.org/plugins/tiny_multilang2, if an user intends to add a plugin to TinyMCE, they are required to install at least two languages in their sites. Moreover, some businesses might disable from installing languages in the Language pack and there is only one language installed. Thus, I have implemented a new feature that allows users to add languages within the multilang2 setting if the system operates with only a single language. This setting would allow users to easily add additional languages within the multilang2 setting. Please refer the image below:
2. Implement “Remove all lang tags” option in the dropdown list.

Currently, users can click one of the language tags then remove it by hitting the backspace or delete key. However, as a user, I think the option to remove all lang tags is necessary. That is why I implement that feature. Please refer the image below:
3. Implement language direction.
It is essential to support languages that use right-to-left scripts such as Arabic, Hebrew, etc. That is the reason for this implementation, wherein I have added the 'dir' attribute to the tag. Please refer the image below:
Furthermore, I'd like to inform you that following the testing of the plugin, our testers have identified several issues in relation to the foundational code. These issues are not too obvious, so I'm highlighting these concerns to ensure you're aware and can determine whether you'd like to take steps to resolve them. The details are outlined below:
Issue 1: {mlang} shows when use p/ Ctrl A/ selecting multiple paragraphs (attached video 1)
Instead of selecting the text by highlight the text, we use Ctrl A/ selecting multiple paragraphs,... to select the text then choose the language. The mlang tag place above and below the text then the editor consider the tag as a separate text. Please refer to the following attachment.
https://drive.google.com/file/d/16tTDX-WWPHSUWIe5UyPCpGPDbAO5YdAA/view?usp=sharing
Issue 2: {mlang} tag is amended based on cursor movement despite highlighting other contents. Please refer to the following attachment.
https://drive.google.com/file/d/1woGcg2gqyGP9Da2XqpnhJnxLyKJYUssU/view?usp=sharing
Issue 3: Change Lang of the first mlang tag.
If there is a selection, then the language tags are placed around the selection and user may click one of these tags then select a new language from the menu and that will change the language of the existing tag.
However, currently, we can only click on the closing tag to change the language multiple times, while for the opening tag, we are unable to do so. Please refer to the following attachment.
https://drive.google.com/file/d/15ilLOk_Wa--w6uGg_XhDAL6JbaKJKtb0/view?usp=sharing
Could you please review the code change? Please let me know if you have any concerns. Thank you.