Redirect to home-page, when change language in Dspace 7.5

101 views
Skip to first unread message

Мухаметали Кусайынов

unread,
Aug 22, 2023, 2:18:54 AM8/22/23
to DSpace Technical Support
Hello dear Dspace community! I can not solve one problem and I ask you for help!
I left only three languages. When changing to any of them, I change the language, but the redirect goes to the home-page. What could be the problem?
Here is my source code:
src/app/shared/lang-switch/lang-switch.component.html

<!-- <div ngbDropdown class="navbar-nav" *ngIf="moreThanOneLanguage" display="dynamic" placement="bottom-right">
  <a href="javascript:void(0);" role="button"
     [attr.aria-label]="'nav.language' |translate"
     [title]="'nav.language' | translate" class="px-1"
     (click)="$event.preventDefault()" data-toggle="dropdown" ngbDropdownToggle
     tabindex="0">
    <i class="fas fa-globe-asia fa-lg fa-fw"></i>
  </a>
  <ul ngbDropdownMenu class="dropdown-menu" [attr.aria-label]="'nav.language' |translate">
    <li class="dropdown-item" tabindex="0" #langSelect *ngFor="let lang of translate.getLangs()"
            (keyup.enter)="useLang(lang)"
            (click)="useLang(lang)"
            [class.active]="lang === translate.currentLang">
                {{ langLabel(lang) }}
    </li>
  </ul>
</div> -->

<div class="lang-block">
  <ul>
    <li class="lang-block-item">
      <a href="" (click)="useLang('en')" class="lang-link">eng</a>
    </li>
    <li class="lang-block-item">
      <a href="" (click)="useLang('kk')" class="lang-link">каз</a>
    </li>
    <li class="lang-block-item">
      <a href="" (click)="useLang('ru')" class="lang-link">рус</a>
    </li>
  </ul>  
</div>

Please suggest specific steps how to solve this problem please!
Thank you very much.
Sincerely, Mukhametali.

DSpace Technical Support

unread,
Aug 22, 2023, 12:26:01 PM8/22/23
to DSpace Technical Support
Hi Mukhametali,

If you simply want to limit the number of languages shown in the header, you can do that via configuration.  There's no need to modify the code in the DSpace User Interface.

Simply change the configuration in your "config.prod.yml" to list *only the languages you wish to have enabled*.  So, if you only want to enable three languages, then only list those 3 languages in your config.*.yml file. See the documentation at https://wiki.lyrasis.org/display/DSDOC7x/User+Interface+Configuration#UserInterfaceConfiguration-LanguageSettings

I've verified that, if you change the configuration, then switching the language will keep you on the same page.  That's the easiest way to fix this problem.

Tim

Мухаметали Кусайынов

unread,
Aug 23, 2023, 4:37:08 AM8/23/23
to DSpace Technical Support
Thank you very mach

вт, 22 авг. 2023 г. в 22:26, DSpace Technical Support <dspac...@googlegroups.com>:
--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to a topic in the Google Groups "DSpace Technical Support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dspace-tech/9ILl6lI5J5s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/6eed6f52-ae2d-4561-a290-4011835cb4a0n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages