Skip to content

Fix the two pages that send the visitor to the wiki - #117

Merged
openipc-ai merged 1 commit into
masterfrom
weird-pages-polish
Aug 25, 2026
Merged

Fix the two pages that send the visitor to the wiki#117
openipc-ai merged 1 commit into
masterfrom
weird-pages-polish

Conversation

@openipc-ai

Copy link
Copy Markdown
Collaborator

Both defects were found while verifying OpenIPC/firmware#1912. Closing that
issue meant quoting the SigmaStar NAND page as it renders today — and it renders
two things it should not.

A stray > on a live page

sigmastar_nand_is_weird.html.erb:25 was

<p class="lead"><%= t('.paragraph1') %>></p>

so the sentence reaches the visitor as "...not included in this guide.>".
It is on openipc.org right now, on the page every SigmaStar NAND owner is
redirected to.

A hardcoded heading on both

<h2 class="mt-5 mb-3">Attention!</h2> — the only string on either of these two
templates not going through i18n. Now firmware.installation.attention, added
to all ten locale files:

en Attention! ru Внимание! de Achtung! es ¡Atención! it Attenzione!
pl Uwaga! pt Atenção! fa توجه! zh 注意! fr Attention !

i18n-tasks missing and i18n-tasks unused are unchanged at 37 and 307
respectively, and neither mentions the new key.

Something the tests turned up

The heading tests assert the Russian string, because the English
translation is exactly the word that was hardcoded — an English assertion passes
whether or not the fix is applied, which is how my first draft passed against
the unfixed template.

Switching locale had to be done with I18n.with_locale, not ?locale=ru,
because that parameter does nothing. Multilang's before_action :set_locale
is commented out at multilang.rb:21, and the locale switcher is commented out
of the layout, so every request renders in English regardless of what it asks
for. Ten locale files are maintained and none of them is ever served. Not
touched here — it deserves its own change and probably a decision — but it is
worth knowing before anyone spends more time on translations.

Verification

bin/rails test — 200 runs, 761 assertions, 0 failures.

revert fails
hardcode both headings 2
put the stray > back 1

Rubocop unchanged apart from the test class counting longer.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YFg9PRy2T6cr983S8gran5

Both found while verifying OpenIPC/firmware#1912, which is about the
SigmaStar NAND page. Closing that issue meant quoting the page as it
renders today, and it renders two defects.

`sigmastar_nand_is_weird.html.erb` had a stray `>` after the ERB tag, so
the sentence reached the page as "...not included in this guide.>". It
is on openipc.org now, on the page every SigmaStar NAND owner is sent to.

Both templates hardcoded the English word "Attention!" as their heading,
the only string on either page not going through i18n. Now
`firmware.installation.attention`, added to all ten locale files.
`i18n-tasks missing` and `i18n-tasks unused` are unchanged at 37 and 307,
neither of which mentions the new key.

The heading tests assert the Russian string, because the English
translation is the word that was hardcoded and an English assertion
passes either way. They switch locale with `I18n.with_locale` rather than
`?locale=ru`, because that parameter does nothing: Multilang's
`before_action :set_locale` is commented out at multilang.rb:21, so every
request renders in English whatever it asks for. That is worth its own
look and is not touched here.

200 runs, 761 assertions. Hardcoding the headings fails both new tests;
putting the stray `>` back fails the SigmaStar one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YFg9PRy2T6cr983S8gran5
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Localize wiki warning headings and remove stray SigmaStar markup

🐞 Bug fix 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Localize warning headings on both wiki-directed firmware pages across ten supported locales.
• Remove the stray greater-than character rendered on the SigmaStar NAND guidance page.
• Add regression coverage for localized headings and clean SigmaStar markup.
Diagram

graph TD
  A["SOC submission"] --> B["SOC controller"] --> C["Warning templates"] --> D["I18n lookup"] --> E[("Locale catalogs")]
  F["Controller tests"] --> B
Loading
High-Level Assessment

The targeted approach is appropriate: both defects are corrected at their source, the shared heading key is populated for every maintained locale, and regressions are verified through rendered responses. Extracting the similar views into a shared partial or re-enabling request-driven locale selection would broaden scope without improving this focused fix.

Files changed (13) +61 / -3

Bug fix (2) +3 / -3
hi3536dv100_is_weird.html.erbLocalize the HI3536 NVR warning heading +1/-1

Localize the HI3536 NVR warning heading

• Replaces the hardcoded English “Attention!” heading with the shared firmware installation translation key.

app/views/cameras/socs/hi3536dv100_is_weird.html.erb

sigmastar_nand_is_weird.html.erbLocalize and clean the SigmaStar NAND warning page +2/-2

Localize and clean the SigmaStar NAND warning page

• Uses the shared translated warning heading and removes the literal greater-than character appended after the lead paragraph translation.

app/views/cameras/socs/sigmastar_nand_is_weird.html.erb

Tests (1) +48 / -0
socs_controller_test.rbCover translated wiki warnings and SigmaStar markup +48/-0

Cover translated wiki warnings and SigmaStar markup

• Adds rendered-response tests for Russian warning headings on both specialized pages. It also verifies the SigmaStar lead paragraph no longer includes the stray greater-than character.

test/controllers/socs_controller_test.rb

Other (10) +10 / -0
de.ymlAdd the German warning heading translation +1/-0

Add the German warning heading translation

• Defines firmware.installation.attention as “Achtung!” for German rendering.

config/locales/de.yml

en.ymlAdd the English warning heading translation +1/-0

Add the English warning heading translation

• Defines firmware.installation.attention as “Attention!” for English rendering.

config/locales/en.yml

es.ymlAdd the Spanish warning heading translation +1/-0

Add the Spanish warning heading translation

• Defines firmware.installation.attention as “¡Atención!” for Spanish rendering.

config/locales/es.yml

fa.ymlAdd the Persian warning heading translation +1/-0

Add the Persian warning heading translation

• Defines firmware.installation.attention as “توجه!” for Persian rendering.

config/locales/fa.yml

fr.ymlAdd the French warning heading translation +1/-0

Add the French warning heading translation

• Defines firmware.installation.attention as “Attention !” for French rendering.

config/locales/fr.yml

it.ymlAdd the Italian warning heading translation +1/-0

Add the Italian warning heading translation

• Defines firmware.installation.attention as “Attenzione!” for Italian rendering.

config/locales/it.yml

pl.ymlAdd the Polish warning heading translation +1/-0

Add the Polish warning heading translation

• Defines firmware.installation.attention as “Uwaga!” for Polish rendering.

config/locales/pl.yml

pt.ymlAdd the Portuguese warning heading translation +1/-0

Add the Portuguese warning heading translation

• Defines firmware.installation.attention as “Atenção!” for Portuguese rendering.

config/locales/pt.yml

ru.ymlAdd the Russian warning heading translation +1/-0

Add the Russian warning heading translation

• Defines firmware.installation.attention as “Внимание!” and supplies the non-English value used by regression tests.

config/locales/ru.yml

zh.ymlAdd the Chinese warning heading translation +1/-0

Add the Chinese warning heading translation

• Defines firmware.installation.attention as “注意!” for Chinese rendering.

config/locales/zh.yml

@openipc-ai
openipc-ai merged commit 73c0961 into master Aug 25, 2026
2 checks passed
@openipc-ai
openipc-ai deleted the weird-pages-polish branch August 25, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant