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

i18n with text-messages not working #449

Closed
abbjetmus opened this issue Apr 22, 2023 · 1 comment
Closed

i18n with text-messages not working #449

abbjetmus opened this issue Apr 22, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@abbjetmus
Copy link

abbjetmus commented Apr 22, 2023

I'm trying to use i18n but setting text-messages prop gives console errors and the chat stops working, any ide how to fix this?
Doesn't working without attribute-binding either.

        <vue-advanced-chat
            ref="chatWindow"
            :height="'100%'"
            :theme="theme"
            :styles="JSON.stringify(styles)"
            :current-user-id="currentUserId"
            :room-id="roomId"
            :rooms="JSON.stringify(loadedRooms)"
            :loading-rooms="loadingRooms"
            :rooms-loaded="roomsLoaded"
            :load-first-room="false"
            :text-messages="{
                ROOMS_EMPTY: 'Inga konversationer',
                ROOM_EMPTY: 'Ingen vald konversation',
                NEW_MESSAGES: 'Nya meddelanden',
                MESSAGE_DELETED: 'Detta meddelande har raderats',
                MESSAGES_EMPTY: 'Inga meddelanden',
                CONVERSATION_STARTED: 'Konversationen startade den:',
                TYPE_MESSAGE: 'Skriv ditt meddelande',
                SEARCH: 'Sök',
                IS_ONLINE: 'är online',
                LAST_SEEN: 'senast sedd ',
                IS_TYPING: 'skriver...',
                CANCEL_SELECT_MESSAGE: 'Avbryt val',
            }"

image

@abbjetmus abbjetmus added the bug Something isn't working label Apr 22, 2023
@abbjetmus
Copy link
Author

My bad you need to stringify the object:

            :text-messages="
                JSON.stringify({
                    ROOMS_EMPTY: 'Inga konversationer',
                    ROOM_EMPTY: 'Ingen vald konversation',
                    NEW_MESSAGES: 'Nya meddelanden',
                    MESSAGE_DELETED: 'Detta meddelande har raderats',
                    MESSAGES_EMPTY: 'Inga meddelanden',
                    CONVERSATION_STARTED: 'Konversationen startade den:',
                    TYPE_MESSAGE: 'Skriv ditt meddelande',
                    SEARCH: 'Sök',
                    IS_ONLINE: 'är online',
                    LAST_SEEN: 'senast sedd ',
                    IS_TYPING: 'skriver...',
                    CANCEL_SELECT_MESSAGE: 'Avbryt val',
                })
            "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant