You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by GitBox <gi...@apache.org> on 2022/05/12 02:23:08 UTC

[GitHub] [guacamole-client] necouchman commented on pull request #668: GUACAMOLE-1293: Add client-side support for receiving join and leave notifications.

necouchman commented on PR #668:
URL: https://github.com/apache/guacamole-client/pull/668#issuecomment-1124463879

   @jmuehlner Okay, I think I've got things mostly reworked, both guacd and guacamole-client side, to where they should be, though the code does need some clean-up (still a bunch of debugging stuff in there), and I'm struggling with one other thing.
   
   I'm trying to make the code as generic as possible, where a message code can be passed through that will then translate to a key that is looked up in the translation system, and then an arbitrary number of arguments can be passed along, as well, that will be substituted into the translation. The general concept of the translation/translation-values is used throughout the code, but I'm struggling with the "arbitrary number" part of it.
   
   My current method is to try to pass through an array of one or more values to the translation-values, and then be able to reference those values as you would any other array. In the template this looks like this:
   
   ```
       <!-- Message text -->
       <p class="client-message-text"
          translate="{{ getClientMessage() }}"
          translate-values="{ ARGS: message.args }"></p>
   ```
   
   and then in the translation file it looks like this:
   ```
           "CLIENT_MESSAGE_JOINED"  : "User {ARGS[0]} has joined the connection.",
           "CLIENT_MESSAGE_LEFT"    : "User {ARGS[0]} has left the connection.",
   ```
   
   But this ends up translating to `User undefined has joined the connection.` I see that the `TranslatableMessage` type has an array called `variables`, but this seems to be key/value pairs (objects), and it also seems to originate from the REST API, and not something generated by guacd. I'm not sure if the right way to go is to retool guacd to send any arguments as key/value pairs (and what that would look like coming out of guacd - just write `key=value`?), or if what I've done above should work and just isn't?
   
   Appreciate any guidance....


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org