Skip to content

Commit

Permalink
Revert "set rtl for sepcific languages automatically"
Browse files Browse the repository at this point in the history
This reverts commit 177e0f1.
  • Loading branch information
LucaB01 committed Jan 29, 2025
1 parent 177e0f1 commit 7ed5339
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 41 deletions.
2 changes: 1 addition & 1 deletion build/cjs/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/esm/index.mjs

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Gleap.setFrameUrl("http://0.0.0.0:3001");
Gleap.setApiUrl("http://0.0.0.0:9000");
Gleap.setWSApiUrl("ws://0.0.0.0:9000");

Gleap.setLanguage("ar-DZ");
// Gleap.setLanguage("en");

Gleap.initialize("VHKvTzWV8jKjms6mWWygiUDWlL8zs7an");

Expand All @@ -17,6 +17,7 @@ Gleap.identify("94383829393", {
})

Gleap.open();

// Gleap.showSurvey("c01abef016b8efb03a9a", "survey_full");


Expand All @@ -26,6 +27,9 @@ Gleap.open();
// Gleap.trackEvent("Step 2 resolved");
// Gleap.trackEvent("Step 3 resolved");

// setTimeout(() => {
// Gleap.trackEvent("Step 4 resolved");
// }, 4000);
// Gleap.setTicketAttribute("qwerrewq", "Custom value")
// Gleap.attachCustomData({
// test: "dataaa",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gleap",
"version": "14.2.4",
"version": "14.2.3",
"main": "build/cjs/index.js",
"module": "build/esm/index.mjs",
"exports": {
Expand Down
1 change: 0 additions & 1 deletion published/14.2.4/index.js

This file was deleted.

2 changes: 1 addition & 1 deletion published/latest/index.js

Large diffs are not rendered by default.

24 changes: 5 additions & 19 deletions src/GleapTranslationManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
GleapSession,
GleapConfigManager,
} from "./Gleap";
import { rtlLanguages } from "./rtlLanguages";

export default class GleapTranslationManager {
overrideLanguage = "";
Expand Down Expand Up @@ -35,29 +34,16 @@ export default class GleapTranslationManager {
this.overrideLanguage = language;
}

checkRTL(language) {
try {
const languageCode = language.split("-")[0];

return rtlLanguages.includes(languageCode);
} catch (error) {
return false;
}
}

updateRTLSupport() {
// Update RTL support.
const flowConfig = GleapConfigManager.getInstance().getFlowConfig();

this.isRTLLayout = false;

if (flowConfig && flowConfig.localizationOptions && flowConfig.localizationOptions.rtl) {
this.isRTLLayout = true;
}

const language = this.getActiveLanguage();
const isRTL = this.checkRTL(language);
if (isRTL) {
if (
flowConfig &&
flowConfig.localizationOptions &&
flowConfig.localizationOptions.rtl
) {
this.isRTLLayout = true;
}

Expand Down
16 changes: 0 additions & 16 deletions src/rtlLanguages.js

This file was deleted.

0 comments on commit 7ed5339

Please sign in to comment.