mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-02 05:33:20 -05:00
Compare commits
4 Commits
feat/custo
...
fix/1535-l
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3be480374 | ||
|
|
44d5530b48 | ||
|
|
a314eb391e | ||
|
|
6c34c316d0 |
9
.codex/environments/environment.toml
Normal file
9
.codex/environments/environment.toml
Normal file
@@ -0,0 +1,9 @@
|
||||
# THIS IS AUTOGENERATED. DO NOT EDIT MANUALLY
|
||||
version = 1
|
||||
name = "formbricks"
|
||||
|
||||
[setup]
|
||||
script = '''
|
||||
pnpm install
|
||||
pnpm dev:setup
|
||||
'''
|
||||
35
README.md
35
README.md
@@ -127,34 +127,10 @@ Formbricks has a hosted cloud offering with a generous free plan to get you up a
|
||||
|
||||
Formbricks is available Open-Source under AGPLv3 license. You can host Formbricks on your own servers using Docker without a subscription.
|
||||
|
||||
If you opt for self-hosting Formbricks, here are a few options to consider:
|
||||
|
||||
#### Docker
|
||||
|
||||
To get started with self-hosting with Docker, take a look at our [self-hosting docs](https://formbricks.com/docs/self-hosting/deployment).
|
||||
|
||||
#### Community-managed One Click Hosting
|
||||
|
||||
##### Railway
|
||||
|
||||
You can deploy Formbricks on [Railway](https://railway.app) using the button below.
|
||||
|
||||
[](https://railway.app/new/template/PPDzCd)
|
||||
|
||||
##### RepoCloud
|
||||
|
||||
Or you can also deploy Formbricks on [RepoCloud](https://repocloud.io) using the button below.
|
||||
|
||||
[](https://repocloud.io/details/?app_id=254)
|
||||
|
||||
##### Zeabur
|
||||
|
||||
Or you can also deploy Formbricks on [Zeabur](https://zeabur.com) using the button below.
|
||||
|
||||
[](https://zeabur.com/templates/G4TUJL)
|
||||
|
||||
<a id="development"></a>
|
||||
|
||||
## 👨💻 Development
|
||||
|
||||
### Prerequisites
|
||||
@@ -248,14 +224,3 @@ We currently do not offer Formbricks white-labeled. That means that we don't sel
|
||||
The Enterprise Edition allows us to fund the development of Formbricks sustainably. It guarantees that the free and open-source surveying infrastructure we're building will be around for decades to come.
|
||||
|
||||
<a id="readme-de"></a>
|
||||
|
||||
## Deutsch
|
||||
|
||||
Formbricks ist eine freie, quelloffene und datenschutzorientierte Plattform für Surveys und Experience Management. Mit In-App-, Website-, Link- und E-Mail-Umfragen sammelt ihr Feedback entlang der gesamten User Journey.
|
||||
|
||||
- Website & Cloud: [formbricks.com](https://formbricks.com/) und [Cloud starten](https://app.formbricks.com/auth/signup)
|
||||
- Self-Hosting: [Deployment-Dokumentation](https://formbricks.com/docs/self-hosting/deployment)
|
||||
- Beitrag & Community: [Beitragen](https://formbricks.com/docs/developer-docs/contributing/get-started), [GitHub Discussions](https://github.com/formbricks/formbricks/discussions) und [Issues](https://github.com/formbricks/formbricks/issues)
|
||||
- Sicherheit & Lizenz: [`SECURITY.md`](./SECURITY.md) und [AGPLv3](https://github.com/formbricks/formbricks/blob/main/LICENSE)
|
||||
|
||||
<p align="right"><a href="#top">🔼 Back to top</a></p>
|
||||
|
||||
@@ -111,6 +111,13 @@ const formbricks = {
|
||||
setNonce,
|
||||
};
|
||||
|
||||
// Explicitly assign to globalThis so the wrapper SDK (@formbricks/js) can
|
||||
// find us even when the UMD environment detection is fooled by a leaked
|
||||
// `exports` or `module` global on the page (e.g. from another UMD bundle,
|
||||
// a tag manager, or a browser extension). This runs inside the UMD factory,
|
||||
// so it executes regardless of which branch the wrapper picks.
|
||||
(globalThis as unknown as Record<string, unknown>).formbricks = formbricks;
|
||||
|
||||
type TFormbricks = typeof formbricks;
|
||||
export type { TFormbricks };
|
||||
export default formbricks;
|
||||
|
||||
@@ -59,7 +59,7 @@ export function LanguageSwitch({
|
||||
handleI18nLanguage(calculatedLanguageCode);
|
||||
|
||||
if (setDir) {
|
||||
const calculateDir = isRTLLanguage(survey, calculatedLanguageCode) ? "rtl" : "auto";
|
||||
const calculateDir = isRTLLanguage(survey, calculatedLanguageCode) ? "rtl" : "ltr";
|
||||
setDir?.(calculateDir);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,12 +9,13 @@ export function RenderSurvey(props: SurveyContainerProps) {
|
||||
const onFinishedTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
||||
const closeTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
||||
const isRTL = isRTLLanguage(props.survey, props.languageCode);
|
||||
const [dir, setDir] = useState<"ltr" | "rtl" | "auto">(isRTL ? "rtl" : "auto");
|
||||
const [dir, setDir] = useState<"ltr" | "rtl" | "auto">(isRTL ? "rtl" : "ltr");
|
||||
|
||||
useEffect(() => {
|
||||
const isRTL = isRTLLanguage(props.survey, props.languageCode);
|
||||
setDir(isRTL ? "rtl" : "auto");
|
||||
}, [props.languageCode, props.survey]);
|
||||
setDir(isRTL ? "rtl" : "ltr");
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps -- Only recalculate direction when languageCode changes, not on survey auto-save
|
||||
}, [props.languageCode]);
|
||||
|
||||
const close = () => {
|
||||
if (onFinishedTimeoutRef.current) {
|
||||
|
||||
@@ -1,20 +1,28 @@
|
||||
import { ComponentChildren } from "preact";
|
||||
import { useEffect } from "preact/hooks";
|
||||
import { useEffect, useRef } from "preact/hooks";
|
||||
import { I18nextProvider } from "react-i18next";
|
||||
import i18n from "../../lib/i18n.config";
|
||||
|
||||
export const I18nProvider = ({ language, children }: { language: string; children?: ComponentChildren }) => {
|
||||
const isFirstRender = useRef(true);
|
||||
const prevLanguage = useRef(language);
|
||||
|
||||
// Set language synchronously on initial render so children get the correct translations immediately.
|
||||
// This is safe because all translations are pre-loaded (bundled) in i18n.config.ts.
|
||||
if (i18n.language !== language) {
|
||||
i18n.changeLanguage(language);
|
||||
}
|
||||
|
||||
// Handle language prop changes after initial render
|
||||
useEffect(() => {
|
||||
// On subsequent renders, skip this to avoid overriding language changes made by the user via LanguageSwitch.
|
||||
if (isFirstRender.current) {
|
||||
if (i18n.language !== language) {
|
||||
i18n.changeLanguage(language);
|
||||
}
|
||||
isFirstRender.current = false;
|
||||
}
|
||||
|
||||
// Only update language when the prop itself changes, not when i18n was changed internally by user action
|
||||
useEffect(() => {
|
||||
if (prevLanguage.current !== language) {
|
||||
i18n.changeLanguage(language);
|
||||
prevLanguage.current = language;
|
||||
}
|
||||
}, [language]);
|
||||
|
||||
// work around for react-i18next not supporting preact
|
||||
|
||||
Reference in New Issue
Block a user