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

Update LunaChat Hook #1484

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

Update LunaChat Hook #1484

wants to merge 5 commits into from

Conversation

2b2tjb
Copy link

@2b2tjb 2b2tjb commented Dec 25, 2022

What did I do?

  • Add LunaChatBukkitPostJapanizeEvent Hook
  • Add LunaChatConvertedMessageFormat to the messages.yml
  • Corrected Japanese translation

Why?

Many people using LunaChat use the Japanese conversion feature (called Japanize in LunaChat) as well as the channel chat function. However, when using the channel chat function, the Japanese conversion string is not sent to Discord. Therefore, I wrote code so that the Japanese conversion string can also be sent to Discord.

And some Japanese translations were strange, so I fixed them.

Copy link
Member

@Vankka Vankka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I understanding this right, that there would be a secondary message containing the native text and another with the roman version?
eg.

Vankka > konnichiwa
[JP] こんいちわ

Thanks for the PR!

src/main/java/github/scarsz/discordsrv/DiscordSRV.java Outdated Show resolved Hide resolved
@2b2tjb
Copy link
Author

2b2tjb commented Jan 2, 2023

Your understanding is right.

It is certainly better that way.
I’ll update.

@Scarsz
Copy link
Member

Scarsz commented Jan 4, 2023

I'd prefer having this as a separate config file. The main config file should be options for DiscordSRV specifically.

A lunachat.yml file could be stored in the resources and only saved if that plugin is detected

Comment on lines +100 to +130
# LunaChat converted message
# LunaChatConvertedMessageFormat: the format used when sending LunaChat converted messages to Discord
# LunaChatConvertedMessageFormatNoPrimaryGroup: used in place of LunaChatConvertedMessageFormat
# when no primary group for the player was found
# Available placeholders:
# %username%: raw player username
# example: jeb_
# %displayname%: display name from things like nicknames
# example: BigBossManJeb
# %usernamenoescapes%: raw player username without escaping discord format (for use in inline code & code block markdown)
# example: jeb_
# %displaynamenoescapes%: display name from things like nicknames without escaping discord format (for use in inline code & code block markdown)
# example: BigBossManJeb
# %original%: original message content
# 例: konnnitiha
# %message%: converted message content
# 例: こんにちは
# %primarygroup%: the name of the user's primary group
# %world%: name of world player is in
# example: world
# %worldalias%: alias of world player is in via Multiverse-Core
# example: Mainland
# %date%: current date & time
# example: Sun Jan 1 15:30:45 PDT 2017
# %channelname%: the name of the channel that the message was sent in, if the message was sent in a channel at all
# example: Global
# PlaceholderAPI placeholders are also supported

LunaChatConvertedMessageFormat: "`[JP] %message%`"
LunaChatConvertedMessageFormatNoPrimaryGroup: "`[JP] %message%`"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to separate lunachat.yml file

# %channelname%: the name of the channel that the message was sent in, if the message was sent in a channel at all
# example: Global
# PlaceholderAPI placeholders are also supported

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No trailing newline after comments

@2b2tjb
Copy link
Author

2b2tjb commented Mar 30, 2023

I apologize for not being able to reply for several months due to being busy.

While I think that the idea of separating the config files is great, the current messages.yml file contains a mixture of Dynmap and channel chat settings, and it feels like the consistency of the files would be lost if only the lunachat config is separated.

I think it would be easier for users to either create a new config file for the hook plugin (hooks.yml) or integrate it into the messages.yml file. What do you think?

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

Successfully merging this pull request may close these issues.

None yet

4 participants