@@ -75,12 +75,12 @@ defmodule PhoenixKit.Modules.Publishing.Web.Controller.Translations do
7575 end
7676
7777 # Check if a specific enabled language has published content in the group
78- # ONLY checks for EXACT file matches - no base code fallback
79- # This ensures only languages with actual files show in the public switcher
78+ # ONLY checks for EXACT matches - no base code fallback
79+ # This ensures only languages with actual content show in the public switcher
8080 # Uses passed posts to avoid redundant list_posts calls
8181 defp has_published_content_for_language? ( posts , language ) do
8282 Enum . any? ( posts , fn post ->
83- # Check if there's a published file for this EXACT language only
83+ # Check if there's published content for this EXACT language only
8484 # Use preloaded language_statuses map
8585 language in ( post . available_languages || [ ] ) and
8686 Map . get ( post . language_statuses , language ) == "published"
@@ -249,30 +249,30 @@ defmodule PhoenixKit.Modules.Publishing.Web.Controller.Translations do
249249 defp normalize_languages ( [ ] , current_language ) , do: [ current_language ]
250250 defp normalize_languages ( languages , _current_language ) when is_list ( languages ) , do: languages
251251
252- # Strict check for public display - only shows files that are:
252+ # Strict check for public display - only shows languages that are:
253253 # 1. Directly in the enabled languages list, OR
254254 # 2. Base code files where any dialect of that base is enabled
255255 # This prevents showing en-US, en-GB etc when only en-CA is enabled
256256 defp language_enabled_for_public? ( language , enabled_languages ) do
257257 cond do
258- # Direct match - file code exactly matches an enabled language
258+ # Direct match - language code exactly matches an enabled language
259259 language in enabled_languages ->
260260 true
261261
262- # Base code file (e.g., "en") - show if any dialect is enabled
262+ # Base code (e.g., "en") - show if any dialect is enabled
263263 Language . base_code? ( language ) ->
264264 Enum . any? ( enabled_languages , fn enabled_lang ->
265265 DialectMapper . extract_base ( enabled_lang ) == language
266266 end )
267267
268- # Dialect file (e.g., "en-US") not directly enabled - DON'T show
268+ # Dialect (e.g., "en-US") not directly enabled - DON'T show
269269 # This is the key difference from language_enabled?
270270 true ->
271271 false
272272 end
273273 end
274274
275- # Checks if the exact language file exists and is published
275+ # Checks if the exact language translation exists and is published
276276 # Uses preloaded language_statuses map to avoid redundant DB reads
277277 defp translation_published_exact? ( _group_slug , post , language ) do
278278 language in ( post . available_languages || [ ] ) and
0 commit comments