Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After changing primary language, Field Guide and Tutorials links missing #154

Open
mcbouslog opened this issue Apr 27, 2020 · 5 comments
Open

Comments

@mcbouslog
Copy link
Contributor

I don't think we're changing a project's primary language (from "en" to anything else) at the moment, so I think this is far from any priority, or possibly something I've done wrong on the project, with the project's translations, or otherwise.

After changing the primary language from "en" to "fr" for https://www.zooniverse.org/lab/4312 the links to translate the Field Guide or Tutorials are missing from https://translations.zooniverse.org/#/project/4312.

With primary language as "en", French translations selected:
Screen Shot 2020-04-27 at 11 48 06 AM
With primary language as "fr", English translations selected:
Screen Shot 2020-04-27 at 11 48 41 AM

@eatyourgreens
Copy link
Contributor

Have you created French versions of the tutorial and field guide? They’ll only show up as links if translations exist for the project’s primary language.

If not, you can create new primary language translations by saving the tutorial and field guide in the project builder.

@eatyourgreens
Copy link
Contributor

The code expects tutorials and field guides to have a language attribute but that’s been removed from Panoptes in favour of having separate Translation resources instead. I think these filters can be removed.

.filter(tutorial => (tutorial.language === project.primary_language))

@camallen
Copy link
Contributor

@mcbouslog is this blocking a project's translation or did you discover this from testing? That'll help us figure out scheduling a bug fix.

@mcbouslog
Copy link
Contributor Author

I discovered this from testing, it's not blocking a project's translations to my knowledge.

@eatyourgreens
Copy link
Contributor

Removing the array filters from this block should fix this (I think.)

<h3>Tutorials</h3>
<ul>
{tutorials
.filter(tutorial => (tutorial.language === project.primary_language))
.map(tutorial =>
(
<li key={tutorial.id}>
<TutorialLink project={project} tutorial={tutorial} />
</li>
)
)}
</ul>
<h3>Field Guides</h3>
<ul>
{fieldguides
.filter(fieldguide => (fieldguide.language === project.primary_language))
.map(fieldguide =>
(
<li key={fieldguide.id}>
<Link
to={`/project/${project.id}/field_guide/${fieldguide.id}`}
>
{fieldguide.id}: {fieldguide.display_name}
</Link>
</li>
)
)}
</ul>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants