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

Export language feature not working #35

Closed
dlucenad opened this issue Nov 18, 2020 · 8 comments · Fixed by #37
Closed

Export language feature not working #35

dlucenad opened this issue Nov 18, 2020 · 8 comments · Fixed by #37
Assignees
Labels
bug Something isn't working locale Issues to do with Multilingual support, localization, etc.

Comments

@dlucenad
Copy link

Hi, my LinkedIn profile has the option of language selection so the viewer can easily change it according to their preference: Portuguese or English. Unfortunately, I can only export my data to JSON in Portuguese, which is my primary profile language. I've tried switching the display language on LinkedIn and also in the drop down menu in the extension but neither of the options work. Any idea of a workaround?

image

image

@joshuatz joshuatz added the bug Something isn't working label Nov 18, 2020
@joshuatz
Copy link
Owner

Thanks for bringing this to my attention; this was working correctly, but I confirm you are correct and this is currently not working.

Looks like LinkedIn changed the way their API works; it used to behave so that a GET request that did not have a specific language requested would always return with en_US (or maybe it was returning with the default user language of the viewer), but now it apparently defaults to the primary language of the profile being viewed.

Note to self: This should be easy to fix, I can probably just initialize instance.preferLocale = 'en_US', but I'll want to double-check that is the best approach.

In the meantime (before I patch and push an update), you should be able to work around this by:

  • Open the popup
  • Change the language to pr_BR, wait a second, then change back to en_US
  • Wait a second, and then hit the run or save button

Toggling back and forth in the popup sets the language string, and doing so should force it to explicitly request en_US.

@dlucenad
Copy link
Author

Hey, thanks for the attention.

I tried toggling the language setting back and forth in the popup 2 times, as you suggested, but it didn't work. I then tried 4 times back and forth and still no luck. Also, I don't know hoe relevant this is, but it didn't have a difference with Run or Save buttons.

Let me know when you have found the fix!

@joshuatz
Copy link
Owner

@dlucenad Hello again.

Apologies for my delay in getting started on this. I just sat down to code the fix for this, and it looks like LinkedIn might have actually reverted the change they made to their API between when I last investigated and now. When you have a moment, could you please check if this is still affecting your profile?

If so, I might have to add some extra debugging to the extension so that I can track down what is specifically happening with your browser.

@joshuatz joshuatz added the question Further information is requested label Nov 27, 2020
@dlucenad
Copy link
Author

Hi @joshuatz, no worries!

Unfortunately this is still not working for my profile. No matter which version of JSONResume I'm using and even if I toggle the language setting back and forth I always get the data in pt_BR.

Let me know how else I can help you.

@joshuatz
Copy link
Owner

I think I finally found the issue. It looks like LinkedIn is in the process of changing how multi-lingual profile data is returned; instead of being separated by request, multiple languages are bundled together and the separate locales are nested layers deep in each response. Even stranger is that this behavior seems to be enabled only for when the creator of a multi-lingual profile is looking at their own profile. This explains why you kept seeing the bug while I could not (in order to track this down, I ended up using a profile that has multiple languages turned on and then tried to extract my own profile).

Unfortunately, this makes this a much harder fix; pretty much every subsection parser (work, education, etc.) is going to have to be updated. Rather than changing one header string, I have to recurse through every response from LI, checking for multiLocale* prefixed nested objects...

I have a bit of a backlog of tasks at that moment, but hopefully this week I can take a crack at this (now that I have a plan of attack) and have another update for you soon. In the meantime, if you urgently need an export of your own profile in en_US, you can always have myself (or another user) export it for you. I'm 90% certain that this should only affect when you view your own profile, but others (probably only those with single-language profiles, like myself) can still successfully toggle export languages.

@joshuatz joshuatz added locale Issues to do with Multilingual support, localization, etc. and removed question Further information is requested labels Nov 29, 2020
@dlucenad
Copy link
Author

Thanks for the in depth feedback and your plan of attack looks promising!

I'm not in a rush to get my profile in English. To be honest I already created a JSONResume in English using the extract from your extension (which for me is only in Portuguese) and translating every sentence by myself. It will be nice to have this working for my type of profile since my LinkedIn is usually my most updated resume and it will save time to update my JSONResume in the future.

Let me know when you need me to test the new version for you.

joshuatz added a commit that referenced this issue Dec 7, 2020
 - This is working towards fix for #35, since Dash endpoint seems to
 be only way to get multi-lang export for your own profile
 - Still need to integrate with parseViaInternalApiFullProfile and
 all other applicable methods
joshuatz added a commit that referenced this issue Dec 7, 2020
 - Tie together alternate Dash endpoint with existing methods
 - Patch extractors that have to be adapted for Dash variation of data
 - Update popup to *always* pass currently selected locale
@joshuatz joshuatz self-assigned this Dec 7, 2020
@joshuatz
Copy link
Owner

joshuatz commented Dec 8, 2020

@dlucenad I believe I have finally patched this issue - released now as v2.1.0.

You can sideload the zip from the release page, or simply wait until Chrome Webstore accepts my update and pushes it out (usually within 24 hours). Once you have the newest version, please give it a test and let me know if the issue still persists for you.

@dlucenad
Copy link
Author

dlucenad commented Dec 9, 2020

Yes, sir! Now it's working fine with both languages from my profile.
Thanks for this awesome plugin and persistence support to try and solve the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working locale Issues to do with Multilingual support, localization, etc.
Projects
None yet
2 participants