MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / _get_primary_locale_code

Method _get_primary_locale_code

src/services/flow_client.py:126–137  ·  view source on GitHub ↗
(self, fallback: str = "en-US")

Source from the content-addressed store, hash-verified

124 return self._normalize_accept_language_header(fallback, fallback=fallback)
125
126 def _get_primary_locale_code(self, fallback: str = "en-US") -> str:
127 fingerprint = self.get_request_fingerprint()
128 if isinstance(fingerprint, dict):
129 language = str(fingerprint.get("language") or "").strip()
130 if language:
131 return language
132 accept_language = str(fingerprint.get("accept_language") or "").strip()
133 if accept_language:
134 primary = accept_language.split(",", 1)[0].strip()
135 if primary:
136 return primary
137 return fallback
138
139 def _infer_sec_ch_ua_from_user_agent(self, user_agent: Optional[str]) -> str:
140 ua = str(user_agent or "").strip()

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected