Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
blockly > utils > analiza > replaceMessageReferences
Funkcja utils.parsing.replaceMessageReferences()
Zastępuje odwołania do tabeli ciągów znaków w wiadomości, jeśli wiadomość jest ciągiem. Na przykład „%{bky_my_msg}” i „%{BKY_MY_MSG}” zostaną zastąpione wartością z Msg ['MY_MSG'].
Podpis:
export declare function replaceMessageReferences(message: string | any): string;
Parametry
Parametr |
Typ |
Opis |
wiadomość |
ciąg znaków | wszystkie |
Komunikat, który może być ciągiem znaków zawierającym odwołania do tabeli z ciągami znaków. |
Zwroty:
ciąg znaków
Ciąg znaków z zastąpionymi odwołaniami do wiadomości.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-08-22 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2024-08-22 UTC."],[[["The `replaceMessageReferences` function substitutes string table references within a message string with their corresponding values from the `Msg` object."],["This function handles both \"%{bky_my_msg}\" and \"%{BKY_MY_MSG}\" formats, replacing them with the value of `Msg['MY_MSG']`."],["The function accepts a message, which can be a string potentially containing references or any other data type, and returns a string with references replaced."],["If the input message is not a string, it is returned unchanged."]]],[]]